Use strongly typed errors based on thiserror #147
Workflow file for this run
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: test | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build Ubuntu / ${{ matrix.toolchain }} | ||
strategy: | ||
matrix: | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo build | ||
run: cargo build | ||
- name: cargo build release | ||
run: cargo build --release | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test Ubuntu / ${{ matrix.toolchain }} | ||
strategy: | ||
matrix: | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features --all-targets | ||
# https://github.com/rust-lang/cargo/issues/6669 | ||
- name: cargo test --doc | ||
run: cargo test --locked --all-features --doc | grep 'Could not authenticate with `CrowdStrike` API: ClientID' | ||
nightly: | ||
name: Rust nightly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rust-src | ||
- run: | | ||
cargo test --lib --bins --examples --benches | ||
- run: | | ||
# We expect doc example to fail without Falcon Credentials | ||
cargo test --doc | grep 'Could not authenticate with `CrowdStrike` API: ClientID' | ||
minimal: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / stable / minimal-versions | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install nightly for -Zminimal-versions | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: rustup default stable | ||
run: rustup default stable | ||
- name: cargo update -Zminimal-versions | ||
run: cargo +nightly update -Zdirect-minimal-versions | ||
- name: cargo test | ||
run: cargo test --locked --all-features --all-targets | ||
os-check: | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.os }} / stable | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest] | ||
steps: | ||
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
if: runner.os == 'Windows' | ||
- run: vcpkg install openssl:x64-windows-static-md | ||
if: runner.os == 'Windows' | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo build | ||
run: cargo build | ||
- name: cargo build release | ||
run: cargo build --release | ||
- name: cargo test | ||
run: cargo test --locked --all-features --all-targets |