-
Notifications
You must be signed in to change notification settings - Fork 141
83 lines (71 loc) · 2.92 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Rust specific tests
name: Rust
on:
push:
jobs:
cargo-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# set a PAT so that add-and-commit can trigger
# CI runs
token: ${{ secrets.GIX_BOT_PAT }}
- uses: ./.github/actions/bootstrap
- name: Cargo fmt
run: |
rustup component add rustfmt
cargo fmt
- name: Cargo fmt VC Issuer
working-directory: demos/vc_issuer
run: |
rustup component add rustfmt
cargo fmt
- name: Commit Formatting changes
uses: EndBug/add-and-commit@v9
# We don't want to commit formatting changes to main
if: ${{ github.ref != 'refs/heads/main' }}
with:
add: "**/*.rs"
default_author: github_actions
message: "🤖 cargo-fmt auto-update"
cargo-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- name: Create dummy assets
run: |
mkdir dist
- run: rustup component add clippy
- name: Cargo clippy
# We run clippy twice (once without tests), so that it accurately reports dead code in the non-test configuration.
# `manual_range_contains` is disabled because a >= x && a < y reads more clearly than (x..y).contains(a) and
# there are additional caveats for floating point numbers (https://github.com/rust-lang/rust-clippy/issues/6455)
run: |
cargo clippy -- -D clippy::all -D warnings -A clippy::manual_range_contains
cargo clippy --tests --benches -- -D clippy::all -D warnings -A clippy::manual_range_contains
- name: Cargo clippy VC Issuer
working-directory: demos/vc_issuer
# We run clippy twice (once without tests), so that it accurately reports dead code in the non-test configuration.
# `manual_range_contains` is disabled because a >= x && a < y reads more clearly than (x..y).contains(a) and
# there are additional caveats for floating point numbers (https://github.com/rust-lang/rust-clippy/issues/6455)
run: |
# dummy assets
mkdir -p dist
touch dist/index.{html,css,js}
touch dist/index2.js
cargo clippy -- -D clippy::all -D warnings -A clippy::manual_range_contains
cargo clippy --tests --benches -- -D clippy::all -D warnings -A clippy::manual_range_contains
check-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
# fails if lockfile is out of date
# https://users.rust-lang.org/t/check-if-the-cargo-lock-is-up-to-date-without-building-anything/91048/5
- name: Cargo Lockfile Check
run: cargo update --workspace --locked
- name: Cargo Issuer Lockfile Check
working-directory: demos/vc_issuer
run: cargo update --workspace --locked