Skip to content

V2/V3 Compability Changes #11914

V2/V3 Compability Changes

V2/V3 Compability Changes #11914

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
NODE_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: Install fresh Bundler packages
run: bin/bundle install
- 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'
cache: 'yarn'
- name: Install fresh Yarn packages
run: bin/yarn install
- name: Run Overcommit commit hooks
run: |
gem install overcommit
overcommit --sign
overcommit --sign pre-commit
overcommit --run
- name: Activate MySQL # as per https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
run: sudo systemctl start mysql.service
- name: Populate database with seeds
run: bin/rake db:reset
- name: Pre-compile assets for frontend tests
env:
DISABLE_SPRING: 1
run: |
bin/bundle exec i18n export
bin/rake assets:precompile
- name: Run tests
id: rspec
run: bin/rspec
- 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