-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (107 loc) · 3.01 KB
/
ci.yml
File metadata and controls
131 lines (107 loc) · 3.01 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
"on":
push:
branches:
- main
- develop
- release/**
pull_request:
branches:
- main
- develop
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby-version: ["3.0", "3.1", "3.2", "3.3"]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec
- name: Upload coverage artifact (Ruby 3.3, Ubuntu only)
if: matrix.ruby-version == '3.3' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 1
- name: Run RuboCop (Ruby 3.3, Ubuntu only)
if: matrix.ruby-version == '3.3' && matrix.os == 'ubuntu-latest'
run: bundle exec rubocop || true
continue-on-error: true
quality:
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- 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
build:
runs-on: ubuntu-latest
needs: [test, quality, security]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Build gem
run: gem build registry.gemspec
- name: Upload gem artifact
uses: actions/upload-artifact@v4
with:
name: gem-package
path: registry-*.gem