Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from "npm ci" to "npm install" for CI #719

Merged
merged 3 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 14 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ commands:
name: install dependencies
command: |
sudo npm install -g n && sudo n 12
npm ci
npm install
bundle check || bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
Expand Down Expand Up @@ -100,6 +100,18 @@ jobs:
name: check optimized images
command: make lint-assets

check-lockfiles:
docker:
- image: cimg/ruby:2.7-node
environment:
SKIP_INSTALL: true
steps:
- checkout
- install-dependencies
- run:
name: check lockfile differences
command: make lint-assets
aduth marked this conversation as resolved.
Show resolved Hide resolved

check-javascript-syntax:
docker:
- image: cimg/ruby:2.7-node
Expand Down Expand Up @@ -137,6 +149,7 @@ workflows:
- build
- eslint
- check-optimized-assets
- check-lockfiles
- test:
requires:
- build
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lint-assets:
npm run viewbox || (echo "Make sure all SVG images have a viewBox attribute"; exit 1)
git diff --quiet assets/img || (echo "Error: Optimize SVG images using 'npm run optimize-assets'"; exit 1)

lint: lint-js lint-assets
lint: lint-js lint-assets validate-lockfiles

test: build
bundle exec rspec spec
Expand All @@ -30,3 +30,15 @@ htmlproofer:
build:
npm run build-js
bundle exec jekyll build

validate-gemfile-lock: Gemfile Gemfile.lock
@echo "Validating Gemfile.lock..."
@bundle check
@git diff-index --quiet HEAD Gemfile.lock || (echo "Error: There are uncommitted changes after running 'bundle install'"; exit 1)

validate-package-lock: package.json package-lock.json
@echo "Validating package-lock.json..."
@[[ -z SKIP_INSTALL ]] && npm install --ignore-scripts || exit 0
@(! git diff --name-only | grep package-lock.json) || (echo "Error: There are uncommitted changes after running 'npm install'"; exit 1)

validate-lockfiles: validate-gemfile-lock validate-package-lock