From ae55285c217a18aa6634aa9ebb3054c51365c3c8 Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Fri, 5 Apr 2024 17:06:37 +0200 Subject: [PATCH] chore: allow to pick which licenses to run --- .github/workflows/update_licenses.yaml | 43 +++++++++++++++++++++----- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/update_licenses.yaml b/.github/workflows/update_licenses.yaml index 67dc8c7ad9..ccf3a79c89 100644 --- a/.github/workflows/update_licenses.yaml +++ b/.github/workflows/update_licenses.yaml @@ -2,22 +2,49 @@ name: Update licenses on: workflow_dispatch: + inputs: + linux: + description: "Update licenses for Ubuntu" + type: boolean + required: false + default: true + mac_silicon: + description: "Update licenses for macOS (silicon)" + type: boolean + required: false + default: true + mac_intel: + description: "Update licenses for macOS (intel)" + type: boolean + required: false + default: true concurrency: group: "${{ github.ref }}-${{ github.event_name }}-${{ github.workflow }}" cancel-in-progress: true + jobs: + # Update licenses for all supported OS update_licenses: strategy: matrix: config: - - {os_name: linux, os: ubuntu-20.04} - - {os_name: mac_intel, os: macos-latest-large} - - {os_name: mac_silicon, os: macos-latest-xlarge} - - runs-on: ${{ matrix.config.os }} + - os_name: linux + if: ${{ inputs.linux }} + - os_name: mac_silicon + if: ${{ inputs.mac_silicon }} + - os_name: mac_intel + if: ${{ inputs.mac_intel }} + - os: ubuntu-latest + if: ${{ inputs.linux }} + - os: macos-latest-xlarge + if: ${{ inputs.mac_silicon }} + - os: macos-latest-large + if: ${{ inputs.mac_intel }} + + runs-on: ${{ matrix.os }} defaults: run: shell: bash @@ -56,11 +83,11 @@ jobs: # Upload the updated license files as artifacts, if they exist - uses: actions/upload-artifact@v4 with: - name: licenses-${{ matrix.config.os_name }} + name: licenses-${{ matrix.os_name }} if-no-files-found: ignore 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: