Skip to content

Commit

Permalink
Action build and test + audit
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulmth committed Nov 30, 2023
1 parent 45a1f9b commit 9ff177a
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Audit

on:
schedule:
- cron: '0 0 * * *' # run at midnight every day
push:
branches:
- main
paths:
- "**/Cargo.lock"
- "**/Cargo.toml"
- ".github/workflows/audit.yml"
- ".cargo/audit.toml"
pull_request:
branches:
- main
paths:
- "**/Cargo.lock"
- "**/Cargo.toml"
- ".github/workflows/audit.yml"
- ".cargo/audit.toml"

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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

- 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'

- name: Setup Rust
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

0 comments on commit 9ff177a

Please sign in to comment.