-
Notifications
You must be signed in to change notification settings - Fork 88
89 lines (78 loc) · 2.88 KB
/
as-basic.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
84
85
86
87
88
89
name: attestation-service basic build and unit tests
on:
push:
branches:
- "main"
paths:
- 'attestation-service/**'
- '.github/workflows/as_basic.yml'
- 'Cargo.toml'
pull_request:
paths:
- 'attestation-service/**'
- '.github/workflows/as_basic.yml'
- 'Cargo.toml'
create:
jobs:
basic_ci:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
steps:
- name: Code checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install OPA command line tool
run: |
curl -L -o opa https://openpolicyagent.org/downloads/v0.42.2/opa_linux_amd64_static
chmod 755 ./opa && cp opa /usr/local/bin
- name: OPA policy.rego fmt and check
run: |
opa fmt -d ./attestation-service/attestation-service/src/policy_engine/opa/default_policy.rego | awk '{ print } END { if (NR!=0) { print "run `opa fmt -w <path_to_rego>` to fix this"; exit 1 } }'
opa check ./attestation-service/attestation-service/src/policy_engine/opa/default_policy.rego
- name: Install protoc
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler libprotobuf-dev
- name: Install TPM build dependencies
run: |
sudo apt-get update
sudo apt-get install -y libtss2-dev
- name: Install TDX build dependencies
run: |
sudo curl -L https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
sudo echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y libsgx-dcap-quote-verify-dev
- name: Install Rust toolchain (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Build
working-directory: attestation-service
run: |
make
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: -p attestation-service -p rvps -p verifier
- name: Run cargo fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p attestation-service -p rvps -p verifier --check
- name: Run rust lint check
uses: actions-rs/cargo@v1
with:
command: clippy
# We are getting error in generated code due to derive_partial_eq_without_eq check, so ignore it for now
args: -p attestation-service -p rvps -p verifier -- -D warnings -A clippy::derive_partial_eq_without_eq