-
-
Notifications
You must be signed in to change notification settings - Fork 188
173 lines (151 loc) · 4.52 KB
/
test.yml
File metadata and controls
173 lines (151 loc) · 4.52 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
env:
# Generic
FORCE_COLOR: "1"
CLICOLOR: "1"
# Python
PYTHONUNBUFFERED: "1"
STABLE_PYTHON_VERSION: "3.13"
jobs:
complete:
name: Test completion check
if: always()
permissions:
contents: none
runs-on: ubuntu-latest
needs:
- sqlite
- postgres
- mysql
- rubocop
- pact-verify
- bundle-audit
- pre-commit
steps:
- name: Failed
run: exit 1
if: >-
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
sqlite:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
ruby_version: ["3.2", "3.3", "3.4"]
env:
OAS_COVERAGE_CHECK_ENABLED: "true"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- run: "bundle install"
- name: Tests
run: "bundle exec rake ci"
postgres:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
postgres_docker_image_tag:
- "13"
- "14"
- "15"
- "16"
- "17"
- "18"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: script/test/run-rake-on-docker-compose-postgres.sh
env:
POSTGRES_DOCKER_IMAGE_TAG: ${{ matrix.postgres_docker_image_tag }}
mysql:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: script/test/run-rake-on-docker-compose-mysql.sh
rubocop:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: "bundle exec rubocop"
pact-verify:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Verify pacts
run: "GIT_SHA=${GITHUB_SHA} bundle exec rake pact:verify"
env:
PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_PACT_FOUNDATION_TOKEN }}
PACT_BROKER_BASE_URL: https://pact-foundation.pactflow.io
pact-v2-verify:
runs-on: "ubuntu-latest"
strategy:
matrix:
pact_url:
- "https://raw.githubusercontent.com/pact-foundation/pact_broker-client/refs/heads/master/spec/pacts/Pact%20Broker%20Client%20V2-Pact%20Broker.json"
- "https://raw.githubusercontent.com/pact-foundation/pact_broker-client/refs/heads/master/spec/pacts/pact_broker_client-pact_broker.json"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle install
- name: Verify pacts
env:
PACT_URL: ${{ matrix.pact_url }}
run: "PACT_URL=${PACT_URL} bundle exec rake pact:v2:verify"
bundle-audit:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Audit
run: "bundle exec rake bundle:audit"
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
env:
PRE_COMMIT_HOME: ${{ github.workspace }}/.pre-commit
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache pre-commit
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
${{ env.PRE_COMMIT_HOME }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-suffix: pre-commit
cache-dependency-glob: ""
- name: Install pre-commit
run: uv tool install pre-commit
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files