Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ jobs:
- checkout
- install-dependencies
- build-site
- persist_to_workspace:
root: "."
paths:
- "_site"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to persist the node_modules etc too? or do we assume that caching will take care of that for us

Copy link
Copy Markdown
Contributor Author

@aduth aduth Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to persist the node_modules etc too? or do we assume that caching will take care of that for us

I did that at first, and I found that it took a very long time for the persist_to_workspace step itself to complete, probably because node_modules is a black hole. And yeah, was hopeful that the caching in install-dependencies could keep it fast enough.

See: fe78bdf


test:
docker:
- image: circleci/ruby:2.6-node-browsers
steps:
- checkout
- install-dependencies
- attach_workspace:
at: "."
- run:
name: run tests
command: bundle exec rspec spec
Expand All @@ -54,11 +67,13 @@ jobs:
accessibility:
docker:
- image: circleci/ruby:2.6-node-browsers
environment:
SKIP_BUILD: true
steps:
- checkout
- install-dependencies
# It's not necessary to build the site prior to running end-to-end tests, as it's done as a
# pre-step of the npm test script.
- attach_workspace:
at: "."
- run:
name: run end-to-end tests
command: npm test
Expand All @@ -83,6 +98,18 @@ jobs:
name: check optimized images
command: make lint-assets

check-javascript-syntax:
docker:
- image: circleci/ruby:2.6-node-browsers
steps:
- checkout
- install-dependencies
- attach_workspace:
at: "."
- run:
name: check es5 syntax
command: npm run es5-safe

# Running external links as a separate job so we don't fail the build directly
# but do get the feedback/info
test-external-links:
Expand All @@ -91,7 +118,8 @@ jobs:
steps:
- checkout
- install-dependencies
- build-site
- attach_workspace:
at: "."
- run:
name: Run htmlproofer (external links only)
command: make htmlproofer_external
Expand All @@ -107,11 +135,24 @@ workflows:
- build
- eslint
- check-optimized-assets
- test-external-links
- accessibility
- test:
requires:
- build
- check-javascript-syntax:
requires:
- build
- test-external-links:
requires:
- build
- accessibility:
requires:
- build
daily-external-link-checker:
jobs:
- test-external-links
- build
- test-external-links:
requires:
- build
triggers:
- schedule:
# Once a day at 12pm
Expand Down
18 changes: 8 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"federalist": "npm run build-js",
"watch-js": "webpack -w --config webpack.config.js --progress --color",
"optimize-assets": "svgo --disable=removeViewBox -r -f assets/img",
"es5-safe": "find _site/assets/js/build -name '*.js' -exec cat {} \\; | acorn --ecma5 --silent",
"viewbox": "./node_modules/.bin/svglint 'assets/img/**/*.svg'",
"lint": "eslint spec webpack.config.js assets",
"pretest": "if [ -z $SKIP_BUILD ]; then make build; fi",
Expand All @@ -29,6 +30,7 @@
"keywords": [],
"devDependencies": {
"@axe-core/puppeteer": "^4.1.0",
"acorn": "^8.1.0",
"eslint": "^7.15.0",
"eslint-plugin-prettier": "^3.2.0",
"get-port": "^5.1.1",
Expand Down