-
Notifications
You must be signed in to change notification settings - Fork 8
137 lines (119 loc) · 4.3 KB
/
ibc-test.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
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
name: IBC test
on:
pull_request:
paths:
- .github/workflows/ibc-test.yaml
- Cargo.toml
- Cargo.lock
- ci/**
- crates/**
- tools/**
push:
branches: [main, '*test*']
paths:
- .github/workflows/ibc-test.yaml
- Cargo.toml
- Cargo.lock
- ci/**
- crates/**
- tools/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ibc-test:
runs-on: ubuntu-20.04
timeout-minutes: 75
env:
SRC_DIR: ${{ github.workspace }}/ibc-test-src
# Branch forcerelay-dev
AXON_COMMIT: 82e07910f687f59cf1f97e45120223f9ee8e948f
IBC_CONTRACT_COMMIT: d33d0ee32b0b89aafac885fd3f68946ea1f2dc68
CELL_EMITTER_COMMIT: 0a897111b389472a078512815d293703910c25d5
strategy:
fail-fast: false
matrix:
chain_a:
- command: ckb
account_prefix: ckb
- command: axon
account_prefix: axon
chain_b:
- command: ckb
account_prefix: ckb
- command: axon
account_prefix: axon
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Create source folder
run: mkdir -p $SRC_DIR
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install yarn
run: npm install --global yarn
- name: Prepare CKB
run: |
if [ ! -f "/tmp/ckb.tar.gz" ]; then
curl -L https://github.com/nervosnetwork/ckb/releases/download/v0.111.0/ckb_v0.111.0_x86_64-unknown-linux-gnu.tar.gz -o /tmp/ckb.tar.gz
fi
tar -zxf /tmp/ckb.tar.gz -C /tmp
echo "/tmp/ckb_v0.111.0_x86_64-unknown-linux-gnu" >> $GITHUB_PATH
- name: Prepare Axon source
run: git clone --recursive https://github.com/axonweb3/axon.git $SRC_DIR/axon && cd $SRC_DIR/axon && git checkout $AXON_COMMIT
- name: Prepare Cell Emitter
run: git clone --recursive https://github.com/axonweb3/emitter.git $SRC_DIR/emitter && cd $SRC_DIR/emitter && git checkout $CELL_EMITTER_COMMIT
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "."
- name: Cache axon bin
id: cache-axon-bin
uses: actions/cache@v3
env:
cache-name: cache-axon-bin
with:
path: ${{env.SRC_DIR}}/axon/target/release/axon
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.AXON_COMMIT }}
- name: Build Axon
if: ${{ steps.cache-axon-bin.outputs.cache-hit != 'true' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --manifest-path ${{env.SRC_DIR}}/axon/Cargo.toml
- name: Add axon bin to path
run: echo "${{env.SRC_DIR}}/axon/target/release/" >> $GITHUB_PATH
- name: Prepare IBC contracts
run: git clone --recursive https://github.com/synapseweb3/ibc-solidity-contract.git $SRC_DIR/ibc-solidity-contract && cd $SRC_DIR/ibc-solidity-contract && git checkout $IBC_CONTRACT_COMMIT
- name: Compile IBC contracts
working-directory: ${{env.SRC_DIR}}/ibc-solidity-contract
run: yarn install && yarn compile
- name: Compile tests
uses: actions-rs/cargo@v1
with:
command: build
args: -p ibc-test --tests --jobs=4
- name: Build Cell Emitter
uses: actions-rs/cargo@v1
with:
command: build
args: --release --manifest-path ${{env.SRC_DIR}}/emitter/Cargo.toml
- name: Add cell-emitter bin to path
run: echo "${{env.SRC_DIR}}/emitter/target/release/" >> $GITHUB_PATH
- name: Run IBC tests
uses: actions-rs/cargo@v1
env:
CHAIN_COMMAND_PATHS: ${{ matrix.chain_a.command }},${{ matrix.chain_b.command }}
ACCOUNT_PREFIXES: ${{ matrix.chain_a.account_prefix }},${{ matrix.chain_b.account_prefix }}
AXON_SRC_PATH: ${{env.SRC_DIR}}/axon
IBC_CONTRACTS_SRC_PATH: ${{env.SRC_DIR}}/ibc-solidity-contract
RUST_LOG: info
RUST_BACKTRACE: 1
with:
command: test
args: -p ibc-test -- --nocapture --test-threads=1