-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (82 loc) · 2.68 KB
/
build-test.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
name: "Build and Deploy"
on:
workflow_call:
secrets:
EVM_DEPLOYER:
required: true
GH_PKG_LOGIN:
required: true
GH_PKG_TOKEN:
required: true
SLACK_BOT_TOKEN:
required: true
env:
EVM_DEPLOYER: ${{ secrets.EVM_DEPLOYER }}
jobs:
build-test:
runs-on: 4x150g-runner
name: Build and Test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install rust toolchain
uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
targets: wasm32-unknown-unknown, i686-unknown-linux-gnu
- name: Install Just command runner
uses: extractions/setup-just@v1
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
cache: false
- name: Install dfx
uses: dfinity/setup-dfx@main
with:
dfx-version: "0.23.0"
- name: Install Protobuf compiler
uses: arduino/setup-protoc@v3
- name: Configure Rust Cache
uses: Swatinem/rust-cache@v2
if: ${{ (github.event.pull_request.base.ref != 'main') && (github.ref_name != 'main') }}
with:
shared-key: ${{ github.repository }}
save-if: ${{ github.ref_type != 'tag' }}
- name: install ic-wasm
run: |
wget https://github.com/dfinity/ic-wasm/releases/download/0.8.1/ic-wasm-linux64 -O /usr/local/bin/ic-wasm
chmod +x /usr/local/bin/ic-wasm
- name: install candid-extractor
run: |
wget https://github.com/dfinity/cdk-rs/releases/download/candid-extractor-v0.1.4/candid-extractor-x86_64-unknown-linux-gnu.tar.gz -O /tmp/candid-extractor-x86_64-unknown-linux-gnu.tar.gz
tar -xvf /tmp/candid-extractor-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin
chmod +x /usr/local/bin/candid-extractor
- name: setup environment
run: |
export RUST_BACKTRACE="full"
sudo apt update
sudo apt install -y gcc-multilib libunwind-dev ca-certificates
- name: build solidity contracts
run: |
just build_solidity
- name: check rust code style
run: |
just check_code
- name: build artifacts
run: |
just build_all_canisters
export GH_API_TOKEN=${{ secrets.GH_PKG_TOKEN }}
just fetch_all_canisters
- name: test
if: ${{ !inputs.skip-test }}
run: |
just test_all
- name: 32bits test
if: ${{ !inputs.skip-test }}
run: |
just test_i686
- name: dfx test
if: ${{ !inputs.skip-test }}
run: |
just dfx_test