Action build and test + audit #3
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: Build and run tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
branches: | |
- main | |
- 'epic/**' | |
- 'support/**' | |
paths: | |
- '.github/workflows/build-and-test.yml' | |
- '.github/actions/**' | |
- '**.rs' | |
- '**.toml' | |
env: | |
RUST_BACKTRACE: full | |
jobs: | |
check-for-run-condition: | |
runs-on: ubuntu-latest | |
outputs: | |
should-run: ${{ !github.event.pull_request || github.event.pull_request.draft == false }} | |
steps: | |
- run: | | |
# this run step does nothing, but is needed to get the job output | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
needs: [ check-for-run-condition ] | |
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Rust and cache | |
uses: './.github/actions/rust/rust-setup' | |
- name: Build | |
run: cargo build --workspace --tests --examples --all-features --release | |
- name: Run tests | |
run: cargo test --workspace --all-features --release | |
- name: Run Rust example | |
run: cargo run --example sd_jwt |