Skip to content

Commit

Permalink
Try to generate workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBusch committed Oct 24, 2024
1 parent 43eaaeb commit 2c6ec8e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/swift_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,58 @@ jobs:
echo "${{ steps.set-matrix.outputs.linux-matrix }}"
echo "${{ steps.set-matrix.outputs.windows-matrix }}"
echo "${{ steps.set-matrix.outputs.windows-nightly-matrix }}"
- name: Generate workflow file
run: |
{
echo "name: Matrix
on:
workflow_call
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
cancel-in-progress: true
jobs:
"
if [[ ${{ steps.set-matrix.outputs.linux-matrix }} == '{"swift": []}' ]]; then
echo " linux:
name: Linux (${\{ matrix.swift.swift_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(steps.set-matrix.outputs.linux-matrix)}}
container:
image: ${\{ matrix.swift.image }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run matrix job
env:
SWIFT_VERSION: ${\{ matrix.swift.swift_version }}
COMMAND: ${{ inputs.matrix_linux_command }}
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }}
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }}
COMMAND_OVERRIDE_6_0: ${{ inputs.matrix_linux_6_0_command_override }}
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }}
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }}
run: |
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"
fi
} >> __matrix_workflow.yml
cat __matrix_workflow.yml
call-matrix:
name: Matrix
uses: ./__matrix_workflow.yml

linux:
name: Linux (${{ matrix.swift.swift_version }})
Expand Down

0 comments on commit 2c6ec8e

Please sign in to comment.