Skip to content

Update links from Delegate Crash Course to Delegate Handbook #9913

Update links from Delegate Crash Course to Delegate Handbook

Update links from Delegate Crash Course to Delegate Handbook #9913

Workflow file for this run

name: Ruby tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
env:
RACK_ENV: test
RAILS_ENV: test
steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2 # set up dummy user.name and user.email in git so that Overcommit doesn't explode
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Corepack/Yarn
run: corepack enable # this allows NPM to use its own Yarn. It is crucial that this is run BEFORE the Node setup!
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules
- uses: actions/cache@v4
with:
path: '~/.cache/yarn'
key: ${{ runner.os }}-yarn
- name: Install fresh Yarn packages
run: bundle exec rake yarn:install
- name: Run Overcommit commit hooks
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: bundle exec overcommit --sign && bundle exec overcommit --sign pre-commit && bundle exec overcommit --run
- name: Activate MySQL # as per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#mysql
run: |
sudo systemctl start mysql.service
- name: Populate database with seeds
run: bundle exec rake db:reset
- name: Pre-compile assets for frontend tests
env:
DISABLE_SPRING: 1
run: bundle exec i18n export && bundle exec rake assets:precompile
- name: Run tests
id: rspec
run: bundle exec rake
- name: Push coverage data to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: 'coverage/lcov/worldcubeassociation.org.lcov'
- uses: actions/upload-artifact@v4
if: always() && steps.rspec.outcome == 'failure'
with:
name: capybara-screenshots
path: tmp/capybara