Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
chore(CircleCI): Get it to working
Browse files Browse the repository at this point in the history
CircleCI

No forwarding needed

Ignore eslint results

Add working_directory

indentation

CircleCI

Alias result artifacts
  • Loading branch information
LekoArts committed Nov 8, 2018
1 parent e54abfd commit 4647411
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 22 deletions.
92 changes: 71 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,87 @@
version: 2
jobs:
e2e_cypress:
executors:
node:
parameters:
image:
type: string
default: "10"
working_directory: ~/app
docker:
- image: cypress/base:8
- image: circleci/node:<< parameters.image >>
environment:
TERM: xterm

aliases:
e2e-executor: &e2e-executor
working_directory: ~/app
docker:
- image: cypress/base:8
environment:
TERM: xterm

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

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

save_cache: &save_cache
save_cache:
name: Save Yarn Package Cache
key: v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.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

e2e_cypress:
<<: *e2e-executor
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v{{ .Environment.versionCache }}-deps-{{ .Branch }}-
- v{{ .Environment.versionCache }}-deps-
- run: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache
- <<: *restore_cache
- <<: *install_node_modules
- <<: *save_cache
- run:
name: Running E2E tests
name: Run E2E tests
command: yarn test:e2e:ci
- store_test_results:
path: test-results
- <<: *store_results
- <<: *store_results_artifacts
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots

workflows:
version: 2
testing:
lint-test:
jobs:
- e2e_cypress
- lint
- e2e_cypress
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jspm_packages
# Build Files
public/
.cache/
results

# Gatsby context
.gatsby-context.js
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@
"serve": "gatsby serve",
"cy:open": "cypress open",
"cy:run": "cypress run",
"cy:run:ci": "cypress run --reporter junit --reporter-options 'mochaFile=test-results/cypress/result.xml'",
"cy:run:ci": "cypress run --reporter junit --reporter-options 'mochaFile=results/cypress/result.xml'",
"lint": "eslint . --ext .js,.jsx --ignore-path .gitignore",
"lint:fix": "eslint . --ext .js,.jsx --fix --ignore-path .gitignore",
"lint:ci": "yarn lint --format junit -o results/eslint/result.xml",
"test:e2e:dev": "start-server-and-test dev http://localhost:8000 cy:open",
"test:e2e:run": "start-server-and-test develop http://localhost:8000 cy:run",
"test:e2e:ci": "start-server-and-test develop http://localhost:8000 cy:run:ci"
Expand Down

0 comments on commit 4647411

Please sign in to comment.