-
-
Notifications
You must be signed in to change notification settings - Fork 928
69 lines (63 loc) · 2.29 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
name: Tests
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
# This is umbrella job for all tests needed to pass to make it simpler
# to maintain GitHub Actions status required checks since job names and
# amount change over the time and it is easier to maintian having just
# this umbrella check set as required.
status_check:
name: All required tests passing check
needs: [rails]
runs-on: ubuntu-24.04
if: always()
steps:
- run: /bin/${{ (needs.rails.result == 'success' || needs.rails.result == 'skipped') }}
rails:
strategy:
fail-fast: false
matrix:
rubygems:
- name: locked
version: "3.5.20"
- name: latest
version: latest
ruby_version: ["3.3.5"]
tests:
- name: general
command: test
- name: system
command: test:system
name: Rails tests ${{ matrix.tests.name }} (RubyGems ${{ matrix.rubygems.name }}, Ruby ${{ matrix.ruby_version }})
runs-on: ubuntu-22.04
env:
RUBYGEMS_VERSION: ${{ matrix.rubygems.version }}
# Fail hard when Toxiproxy is not running to ensure all tests (even Toxiproxy optional ones) are passing
REQUIRE_TOXIPROXY: true
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup rubygems.org
uses: ./.github/actions/setup-rubygems.org
with:
ruby-version: ${{ matrix.ruby_version }}
rubygems-version: ${{ matrix.rubygems.version }}
- name: Tests ${{ matrix.tests.name }}
id: test-all
run: bin/rails ${{ matrix.tests.command }}
- name: Save capybara screenshots
if: ${{ failure() && steps.test-all.outcome == 'failure' }}
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: capybara-screenshots-${{ matrix.tests.name }}-${{ matrix.rubygems.name }}
path: tmp/capybara
if-no-files-found: ignore
- name: Upload coverage to Codecov
if: matrix.rubygems.name == 'locked' && (success() || failure())
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}