From 413d64b3592cd45e0e344588806898044af20ef3 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Mon, 9 Sep 2024 09:34:27 -0400 Subject: [PATCH 1/2] CI: Upgrade {upload,download}-artifact actions to v4 Fixes #2117. --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 849db8804..eefbaccdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,7 +187,7 @@ jobs: prover_tests dest: dist-tests - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: "matrix.ghc == '9.4.8'" with: path: dist-tests @@ -238,7 +238,7 @@ jobs: # distribution version matches the HPC version, the HPC build artifacts do # not clobber the non-HPC distribution artifacts. - if: matrix.ghc == '9.4.8' && matrix.hpc == false - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ steps.config.outputs.name }} (GHC ${{ matrix.ghc }}) path: "${{ steps.config.outputs.name }}.tar.gz*" @@ -246,7 +246,7 @@ jobs: retention-days: ${{ needs.config.outputs.retention-days }} - if: matrix.ghc == '9.4.8' && matrix.hpc == false - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ steps.config.outputs.name }}-with-solvers (GHC ${{ matrix.ghc }}) path: "${{ steps.config.outputs.name }}-with-solvers.tar.gz*" @@ -254,7 +254,7 @@ jobs: retention-days: ${{ needs.config.outputs.retention-days }} - if: matrix.ghc == '9.4.8' && matrix.run-tests && matrix.hpc == false - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: dist/bin name: ${{ matrix.os }}-bins @@ -264,7 +264,7 @@ jobs: run: .github/ci.sh collect_hpc_files - if: matrix.hpc == true - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: hpc.tar.gz name: ${{ matrix.os }}-hpc.tar.gz @@ -296,7 +296,7 @@ jobs: BUILD_TARGET_OS: ${{ matrix.os }} BUILD_TARGET_ARCH: ${{ runner.arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: dist/bin @@ -331,7 +331,7 @@ jobs: BUILD_TARGET_OS: ${{ matrix.os }} BUILD_TARGET_ARCH: ${{ runner.arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: dist/bin @@ -398,7 +398,7 @@ jobs: BUILD_TARGET_OS: ${{ matrix.os }} BUILD_TARGET_ARCH: ${{ runner.arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: dist/bin @@ -461,7 +461,7 @@ jobs: BUILD_TARGET_OS: ${{ matrix.os }} BUILD_TARGET_ARCH: ${{ runner.arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: dist/bin @@ -474,7 +474,7 @@ jobs: if: runner.os != 'Windows' run: chmod +x bin/* - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: dist-tests-${{ matrix.os }} path: dist-tests @@ -554,12 +554,12 @@ jobs: BUILD_TARGET_OS: ${{ matrix.os }} BUILD_TARGET_ARCH: ${{ runner.arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: dist-tests-${{ matrix.os }} path: dist-tests - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-hpc.tar.gz" @@ -609,7 +609,7 @@ jobs: run: | ./compute-coverage.sh - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: hpc-html name: coverage-html-${{ github.event.number }} @@ -755,7 +755,7 @@ jobs: mkdir -p s2nTests/bin - name: Download previously-built SAW - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: ./s2nTests/bin @@ -809,7 +809,7 @@ jobs: mkdir -p exercises/bin - name: Download previously-built SAW - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: "${{ matrix.os }}-bins" path: ./exercises/bin From 0ef0eee0d735b235ea8d59cb7f9bd26ffed3589b Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Mon, 9 Sep 2024 10:21:33 -0400 Subject: [PATCH 2/2] CI: Upload HPC-enabled binaries to separate name Previously, we were inadvertently uploading the HPC-enabled binaries and the non-HPC-enabled binaries to the same name (`dist-tests-${{ matrix.os }}`). This is very dangerous, as this risks the two artifacts clobbering each other. Moreover, `actions/upload-artifact@v4` makes this a hard error, so we now have no choice but to disambiguate the artifact names. --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eefbaccdd..2144b222a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,12 +187,21 @@ jobs: prover_tests dest: dist-tests + # In the next 2 steps, we upload to different names depending on whether + # the binaries were compiled using HPC or not. This is done to ensure that + # the HPC-enabled binaries do not clobber the non-HPC-enabled binaries. - uses: actions/upload-artifact@v4 - if: "matrix.ghc == '9.4.8'" + if: matrix.ghc == '9.4.8' && matrix.hpc == false with: path: dist-tests name: dist-tests-${{ matrix.os }} + - uses: actions/upload-artifact@v4 + if: matrix.ghc == '9.4.8' && matrix.hpc == true + with: + path: dist-tests + name: dist-tests-${{ matrix.os }}-hpc + - shell: bash run: .github/ci.sh setup_dist_bins @@ -556,7 +565,7 @@ jobs: - uses: actions/download-artifact@v4 with: - name: dist-tests-${{ matrix.os }} + name: dist-tests-${{ matrix.os }}-hpc path: dist-tests - uses: actions/download-artifact@v4