forked from remi/her
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (87 loc) · 2.49 KB
/
ci.yml
File metadata and controls
105 lines (87 loc) · 2.49 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
actions: write
contents: read
id-token: write
packages: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
gemfile:
- gemfiles/Gemfile.activemodel-6.1
- gemfiles/Gemfile.activemodel-7.0
- gemfiles/Gemfile.activemodel-7.1
- gemfiles/Gemfile.activemodel-7.2
- gemfiles/Gemfile.activemodel-8.0
exclude:
- ruby: "3.1"
gemfile: gemfiles/Gemfile.activemodel-8.0
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests with coverage
run: bundle exec rake spec
env:
COVERAGE: ${{ matrix.ruby == '3.3' && matrix.gemfile == 'gemfiles/Gemfile.activemodel-8.0' && 'true' || '' }}
- name: Upload coverage artifact
if: matrix.ruby == '3.3' && matrix.gemfile == 'gemfiles/Gemfile.activemodel-8.0'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 1
coverage:
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- uses: actions/checkout@v4
- name: Download coverage artifact
uses: actions/download-artifact@v4
with:
name: coverage-report
path: coverage/
continue-on-error: true
- name: Upload coverage to Qlty
uses: qltysh/qlty-action/coverage@v1
continue-on-error: true
env:
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
with:
oidc: true
files: coverage/coverage.json
- name: Run Qlty code quality checks
run: |
curl -sSfL https://qlty.sh | sh
echo "$HOME/.qlty/bin" >> $GITHUB_PATH
~/.qlty/bin/qlty check || true
continue-on-error: true
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Run bundle audit
run: |
gem install bundler-audit
bundle audit --update || true
continue-on-error: true