Skip to content

Commit

Permalink
Merge pull request #136 from auto-differentiation-dev/main
Browse files Browse the repository at this point in the history
Download reference benchmarks directly using CURL
  • Loading branch information
auto-differentiation-dev authored Nov 15, 2024
2 parents 6dad9df + b20abed commit e86f774
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit e86f774

Please sign in to comment.