build: upgrade to Shakapacker v8 #600
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- production | |
env: | |
RAILS_ENV: test | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
jobs: | |
check-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check dependencies for security vulnerabilities | |
uses: g-rath/check-with-osv-detector@6bf2c012dff284895d644e970294396b01aecc1c | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Install required JS packages | |
run: yarn install | |
- name: Run formatting | |
run: yarn run format-check | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install Ruby (version given by .ruby-version) and Bundler | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Run Ruby linting | |
run: bundle exec rubocop -D | |
brakeman: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install Ruby (version given by .ruby-version) and Bundler | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Run Ruby static analysis | |
run: bundle exec brakeman --run-all-checks . | |
eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Install required JS packages | |
run: yarn install | |
- name: Run JS linting | |
run: yarn run js-lint | |
stylelint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Install required JS packages | |
run: yarn install | |
- name: Run JS linting | |
run: yarn run scss-lint | |
rspec: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready --health-interval 10s --health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
ports: ['6379:6379'] | |
options: >- | |
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout | |
5s --health-retries 5 | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install required OS packages | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install libpq-dev google-chrome-stable ffmpeg | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Install Ruby (version given by .ruby-version) and Bundler | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Prepare database for testing | |
run: | | |
bin/setup | |
bundle exec overcommit --uninstall | |
- name: Run rspec | |
run: bundle exec rake spec SPEC_OPTS="--profile --tag ~@type:system" | |
rspec-system: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready --health-interval 10s --health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
ports: ['6379:6379'] | |
options: >- | |
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout | |
5s --health-retries 5 | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Install required OS packages | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install libpq-dev google-chrome-stable ffmpeg | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Install Ruby (version given by .ruby-version) and Bundler | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Prepare database for testing | |
run: | | |
bin/setup | |
bundle exec overcommit --uninstall | |
- name: Run rspec | |
run: bundle exec rake spec SPEC_OPTS="--profile --tag @type:system" | |
- name: Archive spec outputs | |
uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: rspec-output-screenshots | |
path: tmp/capybara | |
retention-days: 5 |