From b20abedd3d2635f21e5154f10e9ecd61a0045601 Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:52:45 +0000 Subject: [PATCH] Download reference benchmarks directly using CURL --- .github/workflows/benchmarks.yml | 50 ++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 75df387e..747ab004 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -56,14 +56,16 @@ jobs: overwrite: true # if we are in a pull request, pull the uploaded artifact from earlier and run - name: Pull Reference - uses: actions/download-artifact@v4 if: github.event_name == 'pull_request' - with: - name: libor_exe - repository: auto-differentiation/xad - path: build/samples/LiborSwaptionPricer/ref - github-token: ${{ secrets.WORKFLOW_READ_TOKEN }} - run-id: ${{vars.REFERENCE_RUN_ID }} + run: | + mkdir -p build/samples/LiborSwaptionPricer/ref + cd build/samples/LiborSwaptionPricer/ref + curl -H "Authorization: Bearer ${{ secrets.WORKFLOW_READ_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -L \ + "https://api.github.com/repos/auto-differentiation/xad/actions/artifacts/2194914152/zip" \ + --output artifact.zip + unzip artifact.zip - name: Run Reference if: github.event_name == 'pull_request' run: | @@ -113,7 +115,7 @@ jobs: echo "result=| ${REF_TIME}s | ${OUT_TIME}s | ${PERCENTAGE}% |" >> "$GITHUB_OUTPUT" quantlib: - if: contains(github.event.pull_request.labels.*.name, 'benchmarks') || github.event_name == 'workflow_dispatch' + if: github.event_name == 'workflow_dispatch' name: QuantLib Samples runs-on: ubuntu-latest container: ghcr.io/lballabio/quantlib-devenv:noble-1.85.0 @@ -199,23 +201,27 @@ jobs: overwrite: true # if we are in a pull request, pull the uploaded artifact from earlier and run - name: Pull Reference Test-suite - uses: actions/download-artifact@v4 if: github.event_name == 'pull_request' - with: - name: ql_test_exe - repository: auto-differentiation/xad - path: QuantLib/build/test-suite/ref - github-token: ${{ secrets.WORKFLOW_READ_TOKEN }} - run-id: ${{ vars.REFERENCE_RUN_ID }} + run: | + mkdir -p QuantLib/build/test-suite/ref + cd QuantLib/build/test-suite/ref + curl -H "Authorization: Bearer ${{ secrets.WORKFLOW_READ_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -L \ + "https://api.github.com/repos/auto-differentiation/xad/actions/artifacts/2194915762/zip" \ + --output artifact.zip + unzip artifact.zip - name: Pull Reference AdjointBermudan - uses: actions/download-artifact@v4 if: github.event_name == 'pull_request' - with: - name: ql_bermudan_exe - repository: auto-differentiation/xad - path: QuantLib/build/QuantLib-Risks-Cpp/Examples/AdjointBermudanSwaption/ref - github-token: ${{ secrets.WORKFLOW_READ_TOKEN }} - run-id: ${{ vars.REFERENCE_RUN_ID }} + run: | + mkdir -p QuantLib/build/QuantLib-Risks-Cpp/Examples/AdjointBermudanSwaption/ref + cd QuantLib/build/QuantLib-Risks-Cpp/Examples/AdjointBermudanSwaption/ref + curl -H "Authorization: Bearer ${{ secrets.WORKFLOW_READ_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -L \ + "https://api.github.com/repos/auto-differentiation/xad/actions/artifacts/2194915846/zip" \ + --output artifact.zip + unzip artifact.zip - name: Run Reference Test-suite if: github.event_name == 'pull_request' run: |