Benchmark GeoTIFF read speeds #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmarks | |
on: | |
push: | |
branches: ["main"] | |
# Run in PRs but only if the PR has the 'run/benchmark' label | |
pull_request: | |
types: [opened, reopened, labeled, synchronize] | |
# `workflow_dispatch` allows CodSpeed to trigger backtest | |
# performance analysis in order to generate initial data. | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
benchmarks: | |
runs-on: ubuntu-22.04 | |
if: github.repository == 'georust/geotiff' && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run/benchmark')) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download and extract files | |
run: | | |
wget https://s3.us-east-2.amazonaws.com/geotiff-benchmark-sample-files/geotiff_sample_files.tar.gz -P resources | |
tar --extract --verbose --file resources/geotiff_sample_files.tar.gz | |
- name: Setup rust toolchain, cache and cargo-codspeed binary | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: stable | |
cache: false | |
cache-target: release | |
bins: cargo-codspeed | |
- name: Build the benchmark target(s) | |
run: cargo codspeed build | |
- name: Run the benchmarks | |
uses: CodSpeedHQ/action@v3 | |
with: | |
run: cargo codspeed run |