From 483f5a49da93826a49eff232cd2989014fb3fd6c Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Thu, 24 Oct 2024 14:57:52 +0200 Subject: [PATCH] Try to generate workflow file --- .github/workflows/swift_matrix.yml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/swift_matrix.yml b/.github/workflows/swift_matrix.yml index a8d7ab5fa..cae0354a0 100644 --- a/.github/workflows/swift_matrix.yml +++ b/.github/workflows/swift_matrix.yml @@ -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 + } >> .github/workflows/__matrix_workflow.yml + + cat .github/workflows/__matrix_workflow.yml + + + call-matrix: + name: Matrix + uses: ./.github/workflows/__matrix_workflow.yml linux: name: Linux (${{ matrix.swift.swift_version }})