-
Notifications
You must be signed in to change notification settings - Fork 21
87 lines (71 loc) · 2.35 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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: 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