From 654b4061117ba40866a4c35353d0329d78cdb351 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Tue, 25 Feb 2025 09:18:19 +0100 Subject: [PATCH 1/5] test skipping 32-bit matrix configuration --- .github/workflows/matrix.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/matrix.yml diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml new file mode 100644 index 0000000..e5a76f9 --- /dev/null +++ b/.github/workflows/matrix.yml @@ -0,0 +1,43 @@ +name: Test filtering Matrix jobs + +on: + merge_group: + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + bits: [32, 64] + os: + - macos-latest + - ubuntu-latest + - windows-latest + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + - name: Filter + if: ${{ matrix.bits == 32 && github.event_name != 'merge_group' }} + run: exit 0 + - name: Task + run: echo "Task not filtered out" + + matrix-status: + if: ${{ always() }} + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Successful + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Failing + if: ${{ (contains(needs.*.result, 'failure')) }} + run: exit 1 From c8e8af388e3bf9925716121509c82b2bb26c72e9 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Tue, 25 Feb 2025 09:21:49 +0100 Subject: [PATCH 2/5] filter at job level instead --- .github/workflows/matrix.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index e5a76f9..708859e 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -11,6 +11,7 @@ concurrency: jobs: build: + if: ${{ matrix.bits == 32 && github.event_name != 'merge_group' }} strategy: fail-fast: false matrix: @@ -24,9 +25,6 @@ jobs: run: shell: bash steps: - - name: Filter - if: ${{ matrix.bits == 32 && github.event_name != 'merge_group' }} - run: exit 0 - name: Task run: echo "Task not filtered out" From 2b840f2568a3a8fef79668a1754c61ae64206e3c Mon Sep 17 00:00:00 2001 From: wysiwys Date: Tue, 25 Feb 2025 10:11:56 +0100 Subject: [PATCH 3/5] move setup to separate job --- .github/workflows/matrix.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 708859e..d5ee506 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -10,8 +10,7 @@ concurrency: cancel-in-progress: true jobs: - build: - if: ${{ matrix.bits == 32 && github.event_name != 'merge_group' }} + setup: strategy: fail-fast: false matrix: @@ -20,17 +19,24 @@ jobs: - macos-latest - ubuntu-latest - windows-latest + steps: + - name: Report + run: echo "Setup completed" + build: runs-on: ${{ matrix.os }} + if: ${{ github.event_name == 'merge_group' || matrix.bits == 64 }} defaults: run: shell: bash steps: + - name: Filter + run: exit 0 - name: Task run: echo "Task not filtered out" matrix-status: if: ${{ always() }} - needs: [build] + needs: [setup, build] runs-on: ubuntu-latest steps: - name: Successful From dfe93c52cbeb3fd07228db5f49e7bf227ddd76f3 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Tue, 25 Feb 2025 10:13:28 +0100 Subject: [PATCH 4/5] run first job --- .github/workflows/matrix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index d5ee506..964a576 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -19,6 +19,7 @@ jobs: - macos-latest - ubuntu-latest - windows-latest + runs-on: ${{ matrix.os }} steps: - name: Report run: echo "Setup completed" From 99ce5c2f92869e77dbd80fa848cca88d69feb7e6 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Tue, 25 Feb 2025 10:23:49 +0100 Subject: [PATCH 5/5] exclude with exclude tag --- .github/workflows/matrix.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 964a576..0d82ef0 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - setup: + build: strategy: fail-fast: false matrix: @@ -19,25 +19,20 @@ jobs: - macos-latest - ubuntu-latest - windows-latest + exclude: + - bits: 32 + if: ${{ github.event_name != 'merge_group' }} runs-on: ${{ matrix.os }} - steps: - - name: Report - run: echo "Setup completed" - build: - runs-on: ${{ matrix.os }} - if: ${{ github.event_name == 'merge_group' || matrix.bits == 64 }} defaults: run: shell: bash steps: - - name: Filter - run: exit 0 - name: Task run: echo "Task not filtered out" matrix-status: if: ${{ always() }} - needs: [setup, build] + needs: [build] runs-on: ubuntu-latest steps: - name: Successful