-
Notifications
You must be signed in to change notification settings - Fork 127
59 lines (54 loc) · 1.44 KB
/
tests.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
name: Tests
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
COVERAGE_RETENTION_DAYS: 3
jobs:
run_tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Run tests
env:
COVERAGE: true
RAILS_ENV: test
run: bin/rails db:setup test:all
- name: Upload screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
- uses: actions/upload-artifact@v4
with:
name: rails-coverage
path: coverage
if-no-files-found: error
retention-days: ${{ env.COVERAGE_RETENTION_DAYS }}
upload_coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs:
- run_tests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: rails-coverage
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true