.benchmark_template:
stage: benchmark
variables:
TARGET: "x86_64-unknown-linux-gnu"
RESTORE_CACHE: "1"
allow_failure: true
needs: ["x86_64-unknown-linux-gnu"]
clear_benchmarks:
extends: .benchmark_template
allow_failure: false
only:
- master
script:
- rm -rfv public
- mkdir public
- cargo test --all-features --benches
artifacts:
paths:
- public
benchmark_mr:
extends: .benchmark_template
only:
- merge_requests
when: manual
script:
- rm -rf target/criterion
- git remote update
- git fetch
- echo "Checking out \"$CI_MERGE_REQUEST_TARGET_BRANCH_SHA\""
- git checkout $CI_MERGE_REQUEST_TARGET_BRANCH_SHA
- cargo bench --all-features -- --color=always
- git checkout $CI_COMMIT_SHA
- cargo bench --all-features -- --color=always
- rm -rfv public/$CI_COMMIT_REF_SLUG
- mkdir -p public/$CI_COMMIT_REF_SLUG
- mv target/criterion/* public/$CI_COMMIT_REF_SLUG
- echo $CI_PAGES_URL/$CI_COMMIT_REF_SLUG/report/index.html
artifacts:
paths:
- public
benchmark_pr:
extends: .benchmark_template
only:
- external_pull_requests
when: manual
script:
- rm -rf target/criterion
- git remote update
- git fetch
- echo "Checking out \"$CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA\""
- git checkout $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA
- cargo bench --all-features -- --color=always
- git checkout $CI_COMMIT_SHA
- cargo bench --all-features -- --color=always
- rm -rfv public/$CI_COMMIT_REF_SLUG
- mkdir -p public/$CI_COMMIT_REF_SLUG
- mv target/criterion/* public/$CI_COMMIT_REF_SLUG
- echo $CI_PAGES_URL/$CI_COMMIT_REF_SLUG/report/index.html
artifacts:
paths:
- public