-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (81 loc) · 2.66 KB
/
rust.yml
File metadata and controls
101 lines (81 loc) · 2.66 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Rust CI
on:
push:
branches: [ "**" ]
permissions:
contents: read
security-events: write
actions: read
env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ vars.PRIVATE_REPO_ACCESS_APP_ID }}
private-key: ${{ secrets.PRIVATE_REPO_ACCESS_APP_PRIVATE_KEY }}
owner: BitcreditProtocol
- name: Git auth with app token
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
docker system prune -a -f
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo apt-get clean
sudo apt-get autoremove -y
echo "After cleanup:"
df -h
- name: Switch rust version
run: rustup default stable
- name: Update rust
run: rustup update stable
- name: Add rustup components
run: rustup component add clippy rustfmt
- name: Install required cargo tools
run: cargo install cargo-deny clippy-sarif sarif-fmt
- name: Activate cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
prefix-key: "ebill-01"
- name: Check
run: cargo check --verbose
- name: Check formatting
run: cargo fmt -- --check
continue-on-error: true
- name: Clippy
run:
cargo clippy
--verbose
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Cargo deny
run: cargo deny check
continue-on-error: true
- name: Build
run: cargo build --verbose
- name: Install wasm-pack
run: |
curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash
- name: Build WASM version
run: |
cd crates/bcr-ebill-wasm
wasm-pack build --target web
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true