-
Notifications
You must be signed in to change notification settings - Fork 37
118 lines (99 loc) · 4.09 KB
/
system-tests.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
name: System tests
on:
schedule:
- cron: "0 0 * * 0" #weekly, at 00:00 on Sunday
workflow_dispatch:
jobs:
system-tests-deposit-redemption:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
cache-dependency-path: system-tests/yarn.lock
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Install solidity dependencies
working-directory: ./solidity
run: yarn install
- name: Run ethereum node
working-directory: ./solidity
run: |
npx hardhat node --no-deploy &
while [[ -z $(lsof -i :8545 -t) ]]; do echo "Waiting for port 8545 to be open..."; sleep 10; done
- name: Deploy contracts
working-directory: ./solidity
env:
ETH_NETWORK: system_tests
run: |
USE_EXTERNAL_DEPLOY=true npx hardhat deploy --network $ETH_NETWORK --export export.json
- name: Setup scenario prerequisites
working-directory: ./solidity
env:
WALLET_PUBLIC_KEY: ${{ secrets.SYSTEM_TESTS_WALLET_PUBLIC_KEY }}
ETH_NETWORK: system_tests
run: |
npx hardhat test-utils:register-operators --network $ETH_NETWORK
npx hardhat test-utils:create-wallet --wallet-public-key $WALLET_PUBLIC_KEY --network $ETH_NETWORK
- name: Install system tests dependencies
working-directory: ./system-tests
run: yarn install
- name: Run scenario
working-directory: ./system-tests
env:
ETH_NETWORK: system_tests
ELECTRUM_URL: ${{ secrets.SYSTEM_TESTS_ELECTRUM_URL }}
CONTRACTS_DEPLOYMENT_EXPORT_FILE_PATH: ../solidity/export.json
WALLET_BITCOIN_WIF: ${{ secrets.SYSTEM_TESTS_WALLET_PRIVATE_KEY_WIF }}
DEPOSITOR_BITCOIN_WIF: ${{ secrets.SYSTEM_TESTS_DEPOSITOR_PRIVATE_KEY_WIF }}
run: |
yarn test ./test/deposit-redemption.test.ts --network $ETH_NETWORK
system-tests-minting-unminting:
needs: system-tests-deposit-redemption
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
cache-dependency-path: system-tests/yarn.lock
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Install solidity dependencies
working-directory: ./solidity
run: yarn install
- name: Run ethereum node
working-directory: ./solidity
run: |
npx hardhat node --no-deploy &
while [[ -z $(lsof -i :8545 -t) ]]; do echo "Waiting for port 8545 to be open..."; sleep 10; done
- name: Deploy contracts
working-directory: ./solidity
env:
ETH_NETWORK: system_tests
run: |
USE_EXTERNAL_DEPLOY=true npx hardhat deploy --network $ETH_NETWORK --export export.json
- name: Setup scenario prerequisites
working-directory: ./solidity
env:
WALLET_PUBLIC_KEY: ${{ secrets.SYSTEM_TESTS_WALLET_PUBLIC_KEY }}
ETH_NETWORK: system_tests
run: |
npx hardhat test-utils:register-operators --network $ETH_NETWORK
npx hardhat test-utils:create-wallet --wallet-public-key $WALLET_PUBLIC_KEY --network $ETH_NETWORK
- name: Install system tests dependencies
working-directory: ./system-tests
run: yarn install
- name: Run scenario
working-directory: ./system-tests
env:
ETH_NETWORK: system_tests
ELECTRUM_URL: ${{ secrets.SYSTEM_TESTS_ELECTRUM_URL }}
CONTRACTS_DEPLOYMENT_EXPORT_FILE_PATH: ../solidity/export.json
WALLET_BITCOIN_WIF: ${{ secrets.SYSTEM_TESTS_WALLET_PRIVATE_KEY_WIF }}
DEPOSITOR_BITCOIN_WIF: ${{ secrets.SYSTEM_TESTS_DEPOSITOR_PRIVATE_KEY_WIF }}
run: |
yarn test ./test/minting-unminting.test.ts --network $ETH_NETWORK