-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 2 KB
/
ci-local.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
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
name: CI Build and Test (Local setup)
on: [push, pull_request]
# push:
# branches: [ "develop" ]
# pull_request:
# branches: [ "develop" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
file_suffix: "-linux"
- os: macos-latest
file_suffix: "-mac"
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up environment
run: |
echo "Setting up on ${{ matrix.os }}"
mv ic-test-machine-binaries/ic-test-state-machine${{ matrix.file_suffix }} ic-test-state-machine
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Confirm successful installation
run: dfx --version
- name: Install Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install dependencies
run: |
npm install
cargo install ic-wasm
- name: Create canisters and start local ICP replica
run: |
dfx start --clean --background
dfx canister create --all
- name: Set env variables
run: |
export VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=$(dfx canister id civic_canister_frontend)
export VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=$(dfx canister id internet_identity)
export VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=$(dfx canister id civic_canister_backend)
export VITE_LOCAL_RELYING_FRONTEND_CANISTER_ID=$(dfx canister id relying_canister_frontend)
- name: Deploy Canisters
run: |
src/civic_canister_backend/deploy-civic.sh
dfx deploy internet_identity
dfx deploy relying_canister_frontend
dfx deploy civic_canister_frontend
- name: Run tests
run: |
chmod +x ic-test-state-machine
cargo test --test integration_tests
- run: echo "🐧 This job's status is ${{ job.status }}."