From a435157ac3ac5aebb30deaa62b85bac6af7e4262 Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Fri, 19 Apr 2024 13:01:54 +0200 Subject: [PATCH] chore: fix action --- .github/workflows/update_licenses.yaml | 28 ++++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update_licenses.yaml b/.github/workflows/update_licenses.yaml index 88063fcf52..f33fb93d03 100644 --- a/.github/workflows/update_licenses.yaml +++ b/.github/workflows/update_licenses.yaml @@ -26,16 +26,15 @@ concurrency: jobs: # Update licenses for all selected OS # The matrix strategy trick is inspired from https://github.com/orgs/community/discussions/26253 + # Basically, GitHub does not allow to have conditional statements when building matrices. One way + # to do it is to add new boolean fields and exclude the os name by combining them together. Then, + # include the actual os using the 'include' section, which is always processed after 'exclude' + # based on GitHub's documentation : + # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#excluding-matrix-configurations update_licenses: strategy: matrix: - config: - - os_name: linux - os: ubuntu-latest - - os_name: mac_silicon - os: macos-latest-xlarge - - os_name: mac_intel - os: macos-latest-large + os_name: [linux, mac_silicon, mac_intel] triggerLinux: - ${{ inputs.linux }} triggerMacSilicon: @@ -49,10 +48,17 @@ jobs: os_name: mac_silicon - triggerMacIntel: false os_name: mac_intel + include: + - os_name: linux + os: ubuntu-latest + - os_name: mac_silicon + os: macos-latest-xlarge + - os_name: mac_intel + os: macos-latest-large fail-fast: false - runs-on: ${{ matrix.config.os }} + runs-on: ${{ matrix.os }} defaults: run: shell: bash @@ -97,10 +103,10 @@ jobs: - uses: actions/upload-artifact@v4 with: if-no-files-found: ignore - name: licenses_${{ matrix.config.os_name }} + name: licenses_${{ matrix.os_name }} path: | - deps_licenses/licenses_${{ matrix.config.os_name }}_user.txt - deps_licenses/licenses_${{ matrix.config.os_name }}_user.txt.md5 + deps_licenses/licenses_${{ matrix.os_name }}_user.txt + deps_licenses/licenses_${{ matrix.os_name }}_user.txt.md5 # Push the updates license files, as a PR or directly to the branch push_licenses: