-
Notifications
You must be signed in to change notification settings - Fork 21
157 lines (129 loc) · 4.59 KB
/
ci.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: ci
env:
SGX_MODE: SW
IAS_MODE: DEV
RUST_BACKTRACE: full
CONSENSUS_ENCLAVE_CSS: /var/tmp/consensus-enclave.css
INGEST_ENCLAVE_CSS: /var/tmp/ingest-enclave.css
CSS_BASE_URL: https://enclave-distribution.test.mobilecoin.com
on:
pull_request:
branches:
- main
- release/*
concurrency:
group: full-service-ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: [self-hosted, Linux, large]
container:
image: mobilecoin/rust-sgx-base:v0.0.27
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache cargo packages
uses: ./.github/actions/mobilecoin-cache-cargo-package
with:
cache_buster: ${{ secrets.CACHE_BUSTER }}
- name: Consensus SigStruct
run: |
SIGSTRUCT_URI=$(curl -fsSL "${CSS_BASE_URL}/production.json" | jq -r .consensus.sigstruct)
curl -fL --retry 3 "${CSS_BASE_URL}/${SIGSTRUCT_URI}" -o "${CONSENSUS_ENCLAVE_CSS}"
- name: Ingest SigStruct
run: |
SIGSTRUCT_URI=$(curl -fsSL "${CSS_BASE_URL}/production.json" | jq -r .ingest.sigstruct)
curl -fL --retry 3 "${CSS_BASE_URL}/${SIGSTRUCT_URI}" -o "${INGEST_ENCLAVE_CSS}"
- name: Set Git Safe Directory
run: git config --global --add safe.directory /__w/full-service/full-service/
- name: Cargo sort
run: |
cargo install cargo-sort --force
cargo sort --workspace --grouped --check
- name: Cargo fmt
run: |
cargo fmt -- --unstable-features --check
- name: Cargo Clippy
run: |
cargo clippy --all --all-features
test:
runs-on: [self-hosted, Linux, large]
container:
image: mobilecoin/rust-sgx-base:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache cargo packages
uses: ./.github/actions/mobilecoin-cache-cargo-package
with:
cache_buster: ${{ secrets.CACHE_BUSTER }}
- name: Consensus SigStruct
run: |
SIGSTRUCT_URI=$(curl -fsSL "${CSS_BASE_URL}/production.json" | jq -r .consensus.sigstruct)
curl -fL --retry 3 "${CSS_BASE_URL}/${SIGSTRUCT_URI}" -o "${CONSENSUS_ENCLAVE_CSS}"
- name: Ingest SigStruct
run: |
SIGSTRUCT_URI=$(curl -fsSL "${CSS_BASE_URL}/production.json" | jq -r .ingest.sigstruct)
curl -fL --retry 3 "${CSS_BASE_URL}/${SIGSTRUCT_URI}" -o "${INGEST_ENCLAVE_CSS}"
- name: Set Git Safe Directory
run: git config --global --add safe.directory /__w/full-service/full-service/
- uses: actions-rs/cargo@v1
with:
command: test
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
- id: coverage
uses: actions-rs/grcov@v0.1
- name: Codecov
uses: codecov/codecov-action@v3.1.4
with:
files: ${{ steps.coverage.outputs.report }}
verbose: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: 5be757b6-e923-40f2-80ea-5deac1e02b1e
docs:
runs-on: [self-hosted, Linux, large]
container:
image: mobilecoin/rust-sgx-base:latest
permissions:
contents: write
pages: write
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Restore core cache
uses: actions/cache/restore@v3
with:
key: core
path: |
~/.cargo
./target
- name: Consensus SigStruct
run: |
SIGSTRUCT_URI=$(curl -fsSL "${CSS_BASE_URL}/production.json" | jq -r .consensus.sigstruct)
curl -fL --retry 3 "${CSS_BASE_URL}/${SIGSTRUCT_URI}" -o "${CONSENSUS_ENCLAVE_CSS}"
- name: Set Git Safe Directory
run: git config --global --add safe.directory /__w/full-service/full-service/
- name: Build documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
if: github.ref_name == 'main'
with:
target_branch: gh-pages
build_dir: target/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}