Skip to content

Commit 80df713

Browse files
authored
Add linkage test (#53)
### Motivation Ensure that we don't accidentally link the full Foundation on Linux, as we generally only need FoundationEssentials. ### Modifications Adds a script ensuring that the Configuration module only links FoundationEssentials on Linux. ### Result Confidence that we don't accidentally start linking the full Foundation. ### Test Plan CI.
1 parent 618d19d commit 80df713

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,30 @@ jobs:
5454
windows_6_1_enabled: false
5555
windows_nightly_next_enabled: false
5656
windows_nightly_main_enabled: false
57+
58+
construct-linkage-test-matrix:
59+
name: Construct linkage matrix
60+
runs-on: ubuntu-latest
61+
outputs:
62+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v4
66+
with:
67+
persist-credentials: false
68+
- id: generate-matrix
69+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
70+
env:
71+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-configuration/.git && git config --global --add safe.directory /configuration
72+
MATRIX_LINUX_COMMAND: ./Scripts/run-linkage-test.sh
73+
MATRIX_LINUX_5_10_ENABLED: false
74+
MATRIX_LINUX_6_0_ENABLED: false
75+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
76+
77+
linkage-test:
78+
name: Linkage test
79+
needs: construct-linkage-test-matrix
80+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
81+
with:
82+
name: "Integration test"
83+
matrix_string: '${{ needs.construct-linkage-test-matrix.outputs.integration-test-matrix }}'

.github/workflows/pull_request.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,30 @@ jobs:
6161
windows_6_1_enabled: false
6262
windows_nightly_next_enabled: false
6363
windows_nightly_main_enabled: false
64+
65+
construct-linkage-test-matrix:
66+
name: Construct linkage matrix
67+
runs-on: ubuntu-latest
68+
outputs:
69+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
with:
74+
persist-credentials: false
75+
- id: generate-matrix
76+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
77+
env:
78+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-configuration/.git && git config --global --add safe.directory /configuration
79+
MATRIX_LINUX_COMMAND: ./Scripts/run-linkage-test.sh
80+
MATRIX_LINUX_5_10_ENABLED: false
81+
MATRIX_LINUX_6_0_ENABLED: false
82+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
83+
84+
linkage-test:
85+
name: Linkage test
86+
needs: construct-linkage-test-matrix
87+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
88+
with:
89+
name: "Integration test"
90+
matrix_string: '${{ needs.construct-linkage-test-matrix.outputs.integration-test-matrix }}'

0 commit comments

Comments
 (0)