Skip to content

Commit 69aee75

Browse files
committed
.github: use matrix for unit tests
Later on we will want to run the unit tests against different backends. When that is the case, we can just add a new unit_type to this matrix instead of needing to repeat all the same set-up steps.
1 parent 1e83bc3 commit 69aee75

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -175,32 +175,19 @@ jobs:
175175
- name: run check
176176
run: make lint mod-check
177177

178-
########################
179-
# unit race tests
180-
########################
181-
unit-race:
182-
name: unit-race
183-
runs-on: ubuntu-latest
184-
steps:
185-
- name: git checkout
186-
uses: actions/checkout@v3
187-
with:
188-
fetch-depth: 0
189-
190-
- name: setup go ${{ env.GO_VERSION }}
191-
uses: ./.github/actions/setup-go
192-
with:
193-
go-version: '${{ env.GO_VERSION }}'
194-
195-
- name: run check
196-
run: make unit-race
197-
198178
########################
199179
# unit tests
200180
########################
201-
unit:
202-
name: unit tests
181+
unit-test:
182+
name: run unit tests
203183
runs-on: ubuntu-latest
184+
strategy:
185+
# Allow other tests in the matrix to continue if one fails.
186+
fail-fast: false
187+
matrix:
188+
unit_type:
189+
- unit-race
190+
- unit
204191
steps:
205192
- name: git checkout
206193
uses: actions/checkout@v3
@@ -212,8 +199,8 @@ jobs:
212199
with:
213200
go-version: '${{ env.GO_VERSION }}'
214201

215-
- name: run check
216-
run: make unit
202+
- name: run ${{ matrix.unit_type }}
203+
run: make ${{ matrix.unit_type }}
217204

218205
########################
219206
# integration tests

0 commit comments

Comments
 (0)