forked from cc-api/container-integrity-measurement-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.24 KB
/
pr-check-rust.yaml
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
name: Rust Code Scan
on:
push:
branches:
- main
paths:
- 'service/cima-server/**.rs'
- '.github/workflows/pr-check-rust.yaml'
pull_request:
paths:
- 'service/cima-server/**.rs'
- '.github/workflows/pr-check-rust.yaml'
workflow_dispatch:
jobs:
codescan:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Set up Rust action
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
- name: Install dependencies
run: |
sudo apt update && DEBIAN_FRONTEND=noninteractive sudo apt install -y libcryptsetup-dev clang protobuf-compiler protobuf-c-compiler libprotobuf-c-dev libprotobuf-c1 build-essential pkg-config libssl-dev
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip && unzip protoc-26.1-linux-x86_64.zip
sudo mv bin/protoc /usr/bin/protoc && sudo mv include/google/protobuf/* /usr/include/google/protobuf/
- name: Run cargo check
run: |
cd service/cima-server
cargo check
cargo fmt -- --check
cargo clippy
cargo install --locked cargo-deny
cargo deny check