-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (51 loc) · 1.9 KB
/
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
name: Contract Test
on:
push:
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
test:
runs-on: ubuntu-latest
env:
SRC_DIR: ${{ github.workspace }}
# https://github.com/axonweb3/axon/commits/forcerelay-dev
AXON_COMMIT: 343f329b78b8187e28fdac9e9af6c28222656b92
AXON_HTTP_RPC_URL: "http://127.0.0.1:8000"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- 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: 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: Config axon
run: axon init --config ${{env.SRC_DIR}}/axon/devtools/chain/config.toml --chain-spec ${{env.SRC_DIR}}/axon/devtools/chain/specs/single_node/chain-spec.toml
- name: Start axon
run: axon run --config ${{env.SRC_DIR}}/axon/devtools/chain/config.toml &
- run: yarn install
- run: npx truffle version
- run: yarn compile
- name: Run test
run: npx truffle test --network axon_forcerelay