-
Notifications
You must be signed in to change notification settings - Fork 66
57 lines (57 loc) · 1.79 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
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ruby_version: '2.7'
gemfile: rails_7_0
upload_coverage: true
- ruby_version: '2.5'
gemfile: rails_6_1
- ruby_version: '2.3'
gemfile: rails_5_0
- ruby_version: '2.3'
gemfile: rails_4_2
bundler: '1'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CI: 1
BUNDLE_GEMFILE: ${{ github.workspace }}/spec/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- name: "Determine whether to upload coverage"
if: ${{ env.CC_TEST_REPORTER_ID && matrix.upload_coverage }}
run: echo COVERAGE=1 >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby_version }} and ${{ matrix.gemfile }}.gemfile
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler: ${{ matrix.bundler || 'Gemfile.lock' }}
bundler-cache: true
- name: Run tests
if: ${{ !env.COVERAGE }}
run: bundle exec rspec --format d
- name: Run tests and upload coverage
uses: paambaati/[email protected]
if: ${{ env.COVERAGE }}
with:
coverageCommand: bundle exec rspec --format d
i18n-tasks:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/spec/gemfiles/i18n-tasks.gemfile
steps:
- uses: actions/checkout@v3
- name: Set up Ruby and i18n-tasks.gemfile
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Run i18n-tasks
run: bundle exec i18n-tasks health