From 460d3d3b55ead59b1100452e460f6a7bae0e8457 Mon Sep 17 00:00:00 2001 From: disinvite Date: Fri, 14 Mar 2025 11:30:11 -0400 Subject: [PATCH] Verify builds parameter --- .github/workflows/compare.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index b447e181..e25393c2 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -16,12 +16,34 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + # Default to 16 builds per job for push event. + BUILDS: ${{ inputs.builds_per_job && inputs.builds_per_job || 16 }} + jobs: + param-check: + name: Verify builds parameter + runs-on: ubuntu-latest + outputs: + builds: ${{ steps.verify.outputs.builds }} + steps: + - id: verify + run: | + if (( ${{ env.BUILDS }} < 0 || ${{ env.BUILDS }} > 64 )); then + echo "Invalid number of builds!" + exit 1 + else + echo "Builds per job '${{ env.BUILDS }}' OK." + echo "builds=${{ env.BUILDS }}" >> $GITHUB_OUTPUT + fi + fetch-deps: + needs: param-check name: Download original binaries uses: ./.github/workflows/legobin.yml reccmp: + needs: param-check name: Setup python environment runs-on: windows-latest steps: @@ -48,13 +70,13 @@ jobs: build: name: 'MSVC 4.20' - needs: [fetch-deps, reccmp] + needs: [param-check, fetch-deps, reccmp] runs-on: windows-latest strategy: matrix: job: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] builds: - - ${{ inputs.builds_per_job && inputs.builds_per_job || 4 }} + - ${{ needs.param-check.output.builds }} steps: - uses: actions/checkout@v4