Skip to content

Commit

Permalink
[CI] Change how we define the matrix
Browse files Browse the repository at this point in the history
# Motivation

# Modification

# Result
  • Loading branch information
FranzBusch committed Oct 23, 2024
1 parent be823e6 commit 358ddcb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
unit-tests:
name: Unit tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
uses: ./.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/swift_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,21 @@ jobs:
apt-get -qq update && apt-get -qq -y install curl
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: echo "::set-output name=matrix::{\"swift\":[{\"image\":\"swift:6.0-windowsservercore-ltsc2022\",\"swift_version\":\"6.0\",\"enabled\":true}]}"

windows:
name: Windows (${{ matrix.swift.swift_version }})
needs: generate-matrix
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
swift:
- image: swift:6.0-windowsservercore-ltsc2022
swift_version: "6.0"
enabled: ${{ inputs.matrix_windows_6_0_enabled }}
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
steps:
- name: Pull Docker image
if: ${{ matrix.swift.enabled }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
unit-tests:
name: Unit tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
uses: ./.github/workflows/swift_matrix.yml@main
with:
name: "Unit tests"
matrix_linux_command: "swift test"
Expand Down

0 comments on commit 358ddcb

Please sign in to comment.