Skip to content

Commit

Permalink
ci: Refer to nested reusable workflows using remote variant (#2884)
Browse files Browse the repository at this point in the history
### Motivation:

This repo contains reusable workflows, intended for use in _other_
repos. Right now, some of these reusable workflows are nested, i.e. some
of the YAML files refer to other YAML files in the repo by a relative
path.

Unfortunately, this makes them currently unusable locally with `act`
because of nektos/act#1875.

For now, it appears the only workaround is to have these referred to
without the local, relative path.

### Modifications:

Use the remote syntax for referencing nested workflows.

### Result:

Commands like `act -j unit-tests` will work in repos that aren't NIO
itself.

---------

Co-authored-by: Franz Busch <[email protected]>
  • Loading branch information
simonjbeaumont and FranzBusch authored Sep 20, 2024
1 parent 4bf92d5 commit 1109474
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ on:
jobs:
benchmarks:
name: Benchmarks
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Benchmarks"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q libjemalloc-dev && swift package --package-path ${{ inputs.benchmark_package_path }} ${{ inputs.swift_package_arguments }} benchmark baseline check --check-absolute-path ${{ inputs.benchmark_package_path }}/Thresholds/${SWIFT_VERSION}/"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cxx_interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ on:
jobs:
cxx-interop:
name: Cxx interop
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Cxx interop"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q jq && curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash"
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
jobs:
unit-tests:
name: Unit tests
uses: ./.github/workflows/unit_tests.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_8_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
Expand All @@ -17,17 +18,20 @@ jobs:

benchmarks:
name: Benchmarks
uses: ./.github/workflows/benchmarks.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
with:
benchmark_package_path: "Benchmarks"

cxx-interop:
name: Cxx interop
uses: ./.github/workflows/cxx_interop.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

integration-tests:
name: Integration Tests
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration tests"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq && ./scripts/integration_tests.sh"
18 changes: 12 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
jobs:
soundness:
name: Soundness
uses: ./.github/workflows/soundness.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "SwiftNIO"

unit-tests:
name: Unit tests
uses: ./.github/workflows/unit_tests.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_8_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
Expand All @@ -23,21 +25,25 @@ jobs:

benchmarks:
name: Benchmarks
uses: ./.github/workflows/benchmarks.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
with:
benchmark_package_path: "Benchmarks"

cxx-interop:
name: Cxx interop
uses: ./.github/workflows/cxx_interop.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

integration-tests:
name: Integration Tests
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration tests"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq && ./scripts/integration_tests.sh"

swift-6-language-mode:
name: Swift 6 Language Mode
uses: ./.github/workflows/swift_6_language_mode.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
9 changes: 6 additions & 3 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
jobs:
unit-tests:
name: Unit tests
uses: ./.github/workflows/unit_tests.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_8_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
Expand All @@ -17,13 +18,15 @@ jobs:

benchmarks:
name: Benchmarks
uses: ./.github/workflows/benchmarks.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
with:
benchmark_package_path: "Benchmarks"

integration-tests:
name: Integration Tests
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration tests"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq && ./scripts/integration_tests.sh"
3 changes: 2 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ on:
jobs:
unit-tests:
name: Unit tests
uses: ./.github/workflows/swift_matrix.yml
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Unit tests"
matrix_linux_command: "swift test"
Expand Down

0 comments on commit 1109474

Please sign in to comment.