Add stress step to CI #6
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: Stress test the package | |
on: | |
# workflow_dispatch: | |
# TMP: only add this automatic step while developing | |
pull_request: | |
paths: | |
- 'fitsio/**' | |
- 'fitsio-derive/**' | |
- 'fitsio-sys/**' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'Cross.toml' | |
- 'rust-toolchain.toml' | |
- '.github/workflows/*.yml' | |
# Only one pull-request triggered run should be executed at a time | |
# (head_ref is only set for PR events, otherwise fallback to run_id which differs for every run). | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
stress: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- macos-13 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
if: matrix.os != 'ubuntu-latest' | |
run: | | |
brew install cfitsio python3 | |
- name: Install ubuntu dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update && sudo apt-get install --no-install-recommends -y \ | |
llvm-dev \ | |
libcfitsio-dev \ | |
pkg-config \ | |
libssl-dev \ | |
python3 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: beta | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo generate-lockfile | |
# enable this ci template to run regardless of whether the lockfile is checked in or not | |
if: hashFiles('Cargo.lock') == '' | |
run: cargo generate-lockfile | |
- name: Install cargo-stress | |
run: cargo install cargo-stress | |
- name: Stress test the code | |
working-directory: fitsio | |
run: cargo stress | |