Skip to content

Commit 9218c26

Browse files
authored
Switch integration tests & examples to new matrix (#758)
1 parent 02cab48 commit 9218c26

File tree

2 files changed

+86
-15
lines changed

2 files changed

+86
-15
lines changed

.github/workflows/main.yml

+40-4
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,55 @@ 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 && git config --global --add safe.directory /swift-openapi-generator/.git && git config --global --add safe.directory /swift-openapi-generator
40+
MATRIX_LINUX_COMMAND: SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${workspace} ./scripts/run-integration-test.sh
41+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
42+
2643
integration-test:
2744
name: Integration test
28-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
45+
needs: construct-integration-test-matrix
46+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
2947
with:
3048
name: "Integration test"
31-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
49+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
50+
51+
construct-example-packages-matrix:
52+
name: Construct example packages matrix
53+
runs-on: ubuntu-latest
54+
outputs:
55+
example-packages-matrix: '${{ steps.generate-matrix.outputs.example-packages-matrix }}'
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
with:
60+
persist-credentials: false
61+
- id: generate-matrix
62+
run: echo "example-packages-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
63+
env:
64+
MATRIX_LINUX_SETUP_COMMAND: git config --global --add safe.directory /swift-openapi-generator
65+
MATRIX_LINUX_COMMAND: ./scripts/test-examples.sh
66+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
3267

3368
example-packages:
3469
name: Example packages
35-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
70+
needs: construct-example-packages-matrix
71+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
3672
with:
3773
name: "Example packages"
38-
matrix_linux_command: "./scripts/test-examples.sh"
74+
matrix_string: '${{ needs.construct-example-packages-matrix.outputs.example-packages-matrix }}'
3975

4076
macos-tests:
4177
name: macOS tests

.github/workflows/pull_request.yml

+46-11
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ jobs:
2929
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
3030
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
3131

32-
integration-test:
33-
name: Integration test
34-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
35-
with:
36-
name: "Integration test"
37-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
38-
matrix_linux_nightly_main_enabled: false
39-
4032
compatibility-test:
4133
name: Compatibility test
4234
runs-on: ubuntu-latest
@@ -56,13 +48,56 @@ jobs:
5648
SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS: 1
5749
run: swift test --filter ${SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER}
5850

51+
construct-integration-test-matrix:
52+
name: Construct integration matrix
53+
runs-on: ubuntu-latest
54+
outputs:
55+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
with:
60+
persist-credentials: false
61+
- id: generate-matrix
62+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
63+
env:
64+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-openapi-generator/.git && git config --global --add safe.directory /swift-openapi-generator
65+
MATRIX_LINUX_COMMAND: SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${workspace} ./scripts/run-integration-test.sh
66+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
67+
68+
integration-test:
69+
name: Integration test
70+
needs: construct-integration-test-matrix
71+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
72+
with:
73+
name: "Integration test"
74+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
75+
76+
construct-example-packages-matrix:
77+
name: Construct example packages matrix
78+
runs-on: ubuntu-latest
79+
outputs:
80+
example-packages-matrix: '${{ steps.generate-matrix.outputs.example-packages-matrix }}'
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
with:
85+
persist-credentials: false
86+
- id: generate-matrix
87+
run: echo "example-packages-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
88+
env:
89+
MATRIX_LINUX_SETUP_COMMAND: git config --global --add safe.directory /swift-openapi-generator
90+
MATRIX_LINUX_COMMAND: ./scripts/test-examples.sh
91+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
92+
5993
example-packages:
6094
name: Example packages
61-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
95+
needs: construct-example-packages-matrix
96+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
6297
with:
6398
name: "Example packages"
64-
matrix_linux_command: "./scripts/test-examples.sh"
65-
matrix_linux_nightly_main_enabled: false
99+
matrix_string: '${{ needs.construct-example-packages-matrix.outputs.example-packages-matrix }}'
100+
66101

67102
macos-tests:
68103
name: macOS tests

0 commit comments

Comments
 (0)