Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Create uses-with-expression action #2922

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/uses_with_expression/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Uses with expression
description: Dynamic step that allows `uses` with expressions.
inputs:
uses_with_expression:
description: Reference to an action that allows expressions.
required: true
with:
description: Inputs for the action as JSON.
required: false
default: "{}"
runs:
using: composite
steps:
- name: Create local action
shell: bash
run: |
mkdir -p ./.uses_with_expression &&
cat <<'LOCAL_ACTION' >./.uses_with_expression/action.yml
runs:
using: composite
steps:
- run: rm -rf ./.uses_with_expression
shell: sh
- name: Run
id: run
uses: ${{ inputs.uses_with_expression }}
with: ${{ inputs.with || '{}' }}
LOCAL_ACTION
- name: Run local action
id: run
uses: ./.uses_with_expression
- name: Cleanup local action
if: always() && steps.run.outcome != 'success'
shell: bash
run: rm -rf ./.uses_with_expression
15 changes: 9 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ 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/actions/uses_with_expression/
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"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
uses_with_expression: apple/swift-nio/.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"
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"}'


benchmarks:
name: Benchmarks
Expand Down
Loading