Skip to content

Commit 21c25ab

Browse files
committed
Switch integration tests to newer Swift test matrix
Motivation: To remove all uses of the older workflow so it can be removed to simplify the workflows. Modifications: * Switch integration tests to use the newer Swift test matrix workflow, `swift_test_matrix.yml` * As part of this I had to add a git config command to the setup instructions. Lots of other repos have been using the matrix workflow without needing this so I'm unsure of why it's needed here. If it becomes common I'll look at a central way to include this. Result: This should make no difference to the running of integration tests.
1 parent 8f33cc5 commit 21c25ab

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,30 @@ jobs:
2323
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
2424
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2525

26+
construct-integration-test-matrix:
27+
name: Construct integration matrix
28+
runs-on: ubuntu-latest
29+
outputs:
30+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
with:
35+
persist-credentials: false
36+
- id: generate-matrix
37+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
38+
env:
39+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq
40+
MATRIX_LINUX_COMMAND: ./scripts/run-integration-test.sh
41+
2642
integration-test:
2743
name: Integration test
28-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
44+
needs: construct-integration-test-matrix
45+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
2946
with:
3047
name: "Integration test"
31-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
48+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
49+
matrix_linux_nightly_main_enabled: false
3250

3351
static-sdk:
3452
name: Static SDK

.github/workflows/pull_request.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,30 @@ jobs:
2727
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
2828
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2929

30+
construct-integration-test-matrix:
31+
name: Construct integration matrix
32+
runs-on: ubuntu-latest
33+
outputs:
34+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
40+
- id: generate-matrix
41+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
42+
env:
43+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-openapi-runtime
44+
MATRIX_LINUX_COMMAND: ./scripts/run-integration-test.sh
45+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
46+
3047
integration-test:
3148
name: Integration test
32-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
49+
needs: construct-integration-test-matrix
50+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
3351
with:
3452
name: "Integration test"
35-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
36-
matrix_linux_nightly_main_enabled: false
53+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
3754

3855
static-sdk:
3956
name: Static SDK

0 commit comments

Comments
 (0)