Skip to content

Commit d74fed7

Browse files
committed
Action build and test + audit
1 parent 45a1f9b commit d74fed7

File tree

4 files changed

+169
-0
lines changed

4 files changed

+169
-0
lines changed

.github/workflows/audit.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Audit
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "**/Cargo.lock"
9+
- "**/Cargo.toml"
10+
- ".github/workflows/audit.yml"
11+
- ".cargo/audit.toml"
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- "**/Cargo.lock"
17+
- "**/Cargo.toml"
18+
- ".github/workflows/audit.yml"
19+
- ".cargo/audit.toml"
20+
21+
jobs:
22+
audit:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions-rs/audit-check@v1
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-and-test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and run tests Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ opened, synchronize, reopened, ready_for_review ]
9+
branches:
10+
- main
11+
- 'epic/**'
12+
- 'support/**'
13+
paths:
14+
- '.github/workflows/build-and-test.yml'
15+
- '.github/actions/**'
16+
- '**.rs'
17+
- '**.toml'
18+
19+
env:
20+
RUST_BACKTRACE: full
21+
22+
jobs:
23+
check-for-run-condition:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
should-run: ${{ !github.event.pull_request || github.event.pull_request.draft == false }}
27+
steps:
28+
- run: |
29+
# this run step does nothing, but is needed to get the job output
30+
31+
build-and-test:
32+
runs-on: ubuntu-latest
33+
needs: [ check-for-run-condition ]
34+
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ ubuntu-latest]
39+
40+
steps:
41+
- uses: actions/checkout@v3
42+
43+
- name: Setup Rust
44+
uses: './.github/actions/rust/rust-setup'
45+
46+
- name: Build
47+
run: cargo build --workspace --tests --examples --all-features --release
48+
49+
- name: Run tests
50+
run: cargo test --workspace --all-features --release
51+
52+
- name: Run Rust example
53+
run: cargo run --example sd_jwt

.github/workflows/build-windows.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and run tests Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ opened, synchronize, reopened, ready_for_review ]
9+
branches:
10+
- main
11+
- 'epic/**'
12+
- 'support/**'
13+
paths:
14+
- '.github/workflows/build-and-test.yml'
15+
- '.github/actions/**'
16+
- '**.rs'
17+
- '**.toml'
18+
19+
env:
20+
RUST_BACKTRACE: full
21+
22+
jobs:
23+
check-for-run-condition:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
should-run: ${{ !github.event.pull_request || github.event.pull_request.draft == false }}
27+
steps:
28+
- run: |
29+
# this run step does nothing, but is needed to get the job output
30+
31+
build-and-test:
32+
runs-on: windows-latest
33+
needs: [ check-for-run-condition ]
34+
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
35+
strategy:
36+
fail-fast: false
37+
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Setup Rust
42+
uses: './.github/actions/rust/rust-setup'
43+
44+
- name: Build
45+
run: cargo build --workspace --all-feature --release

.github/workflows/format.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
- 'epic/**'
11+
- 'support/**'
12+
paths:
13+
- '.github/workflows/format.yml'
14+
- '**.rs'
15+
- '**.toml'
16+
- '**.ts'
17+
- '**.js'
18+
- '**.json'
19+
20+
jobs:
21+
format:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
# we use nightly to get access to advanced format capabilities
30+
- name: Setup Rust
31+
uses: './.github/actions/rust/rust-setup'
32+
with:
33+
toolchain: nightly
34+
components: rustfmt
35+
36+
- name: Install cargo-license-template
37+
run: cargo install cargo-license-template
38+
39+
- name: core fmt check
40+
run: cargo +nightly fmt --all -- --check
41+
42+
- name: cargo-license-template check
43+
run: cargo +nightly license-template --template .license_template --ignore .license_template_ignore --verbose

0 commit comments

Comments
 (0)