WIP: API key authorization #24296
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: Test | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
backend-tests: | |
name: Run RSpec (${{ matrix.test_params.name }}) | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
test_params: | |
- | |
name: system - jobseekers | |
params: 'spec/system/jobseekers' | |
- | |
name: system - publishers | |
params: 'spec/system/publishers' | |
- | |
name: system - support users | |
params: 'spec/system/support_users' | |
- | |
name: system - other | |
params: 'spec/system/other' | |
- | |
name: unit | |
params: '--exclude-pattern "spec/{system}/*_spec.rb, spec/system/{jobseekers,publishers,support_users,other}/*_spec.rb"' | |
env: | |
DATABASE_URL: postgis://postgres:postgres@localhost:5432/tvs_test | |
RAILS_ENV: test | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
services: | |
postgres: | |
image: postgis/postgis:14-3.4-alpine | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare application environment | |
uses: ./.github/actions/prepare-app-env | |
- name: Set up test database | |
run: bin/rails db:create db:schema:load | |
- name: Generate Swagger (OpenAPI) docs | |
run: bundle exec rake rswag:specs:swaggerize | |
- name: Precompile assets | |
run: bin/rails assets:precompile | |
- name: Run tests | |
run: bundle exec rspec ${{ matrix.test_params.params }} | |
- name: Upload Capybara failures screenshots | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capybara-screenshots-${{ matrix.test_params.name }} | |
path: /home/runner/work/teaching-vacancies/teaching-vacancies/tmp/capybara/*.png | |
if-no-files-found: ignore # If only non-capybara tests fail there will be no screenshots | |
frontend-tests: | |
name: Run frontend JS unit tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare application environment | |
uses: ./.github/actions/prepare-app-env | |
with: | |
skip-ruby: true | |
- name: run frontend tests and linting | |
run: yarn run js:test |