Skip to content

Commit 471d314

Browse files
committed
Use matrix strategy for debug and release builds
1 parent 182beb4 commit 471d314

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
build:
2323
name: "Build & package"
2424
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
build-configuration: [ Debug, Release ]
2528
env:
2629
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true
2730

@@ -48,26 +51,24 @@ jobs:
4851
run: just format --verify-no-changes
4952

5053
- name: Build
51-
run: |
52-
just build --configuration Debug --no-restore /p:GeneratePackageOnBuild=false
53-
just build --configuration Release --no-restore /p:GeneratePackageOnBuild=false
54+
run: just build --configuration ${{ matrix.build-configuration }} --no-restore /p:GeneratePackageOnBuild=false
55+
56+
- name: Build samples
57+
run: just build-samples --configuration ${{ matrix.build-configuration }}
5458

5559
- name: Install Playwright
5660
run: just install-playwright
5761

5862
- name: Test
5963
run: |
60-
just unit-tests --configuration Debug --no-build
61-
just conformance-tests --configuration Debug --no-build
62-
just integration-tests --configuration Debug --no-build
63-
64-
just unit-tests --configuration Release --no-build
65-
just conformance-tests --configuration Release --no-build
66-
just integration-tests --configuration Release --no-build
64+
just unit-tests --configuration ${{ matrix.build-configuration }} --no-build
65+
just conformance-tests --configuration ${{ matrix.build-configuration }} --no-build
66+
just integration-tests --configuration ${{ matrix.build-configuration }} --no-build
6767
6868
- name: Check documentation
69+
if: matrix.build-configuration == 'Release'
6970
run: |
70-
just publish-docs --configuration Release
71+
just publish-docs --configuration ${{ matrix.build-configuration }}
7172
7273
changes=$(git status --porcelain docs ':!docs/images' | cut -c 4-)
7374
if [ -n "$changes" ]
@@ -77,14 +78,12 @@ jobs:
7778
fi
7879
7980
- name: Pack
80-
run: just pack --configuration Release
81+
run: just pack --configuration ${{ matrix.build-configuration }}
8182
env:
8283
MINVERBUILDMETADATA: build.${{ github.run_id }}.${{ github.run_attempt}}
8384

84-
- name: Build samples
85-
run: just build-samples --configuration Release
86-
8785
- name: Publish package artifact
86+
if: matrix.build-configuration == 'Release'
8887
uses: actions/upload-artifact@v4
8988
with:
9089
name: GovUk.Frontend.AspNetCore.nupkg

0 commit comments

Comments
 (0)