Skip to content

Commit

Permalink
feat: Add CircleCI config (#15)
Browse files Browse the repository at this point in the history
* chore: Add circleci config file

* chore: update README with status badge

Added the a first test to the workflow: Linting

Closes #13
  • Loading branch information
LekoArts committed Aug 1, 2019
1 parent 2f1bb19 commit 2e42080
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
executors:
node:
parameters:
image:
type: string
default: "lts"
docker:
- image: circleci/node:<< parameters.image >>
environment:
TERM: xterm

aliases:
restore_cache: &restore_cache
restore_cache:
name: Restore Yarn Package Cache
keys:
- v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}

install_node_modules: &install_node_modules
run:
name: Install Yarn Packages
command: yarn install --frozen-lockfile --ignore-engines

save_cache: &save_cache
save_cache:
name: Save Yarn Package Cache
key: v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
paths:
- /home/circleci/.cache

store_results: &store_results
store_test_results:
path: results

store_results_artifacts: &store_results_artifacts
store_artifacts:
path: results

version: 2.1

jobs:
lint:
executor: node
steps:
- checkout
- <<: *restore_cache
- <<: *install_node_modules
- <<: *save_cache
- run:
name: Run ESLint
command: yarn lint:ci
- <<: *store_results
- <<: *store_results_artifacts

workflows:
version: 2
lint-test:
jobs:
- lint
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Lennart
Copyright (c) 2019 LekoArts

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<a href="https://github.com/LekoArts/gatsby-themes/blob/master/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="@lekoarts/gatsby-themes is released under the MIT license." />
</a>
<a href="https://circleci.com/gh/LekoArts/gatsby-themes">
<img src="https://circleci.com/gh/LekoArts/gatsby-themes.svg?style=svg" alt="CircleCI Status" />
</a>
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
<a href="https://twitter.com/intent/follow?screen_name=lekoarts_de">
<img src="https://img.shields.io/twitter/follow/lekoarts_de.svg?label=Follow%20@lekoarts_de" alt="Follow @lekoarts_de" />
Expand Down Expand Up @@ -49,4 +52,4 @@ If you want to receive monthly updates on my themes and all things related to Ga

- [Gatsbyjs.org - Gatsby Themes](https://www.gatsbyjs.org/docs/themes/)
- [Building a Theme](https://www.gatsbyjs.org/tutorial/building-a-theme)
- [Free egghead.io "Gatsby Theme Authoring" course](https://egghead.io/courses/gatsby-theme-authoring)
- [Free egghead.io "Gatsby Theme Authoring" course](https://egghead.io/courses/gatsby-theme-authoring)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"tsc": "tsc",
"lint": "eslint './themes/**/*' './examples/**/*'",
"lint:fix": "yarn lint --fix",
"lint:ci": "yarn lint --format junit -o results/eslint/result.xml",
"format": "prettier \"{examples,themes}/**/*.md\" --write",
"format:mdx": "prettier --parser mdx \"{examples,themes}/**/*.mdx\" --write",
"lerna": "lerna"
Expand Down

0 comments on commit 2e42080

Please sign in to comment.