-
Notifications
You must be signed in to change notification settings - Fork 19
61 lines (55 loc) · 1.9 KB
/
regression-contract-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
name: Regression Contract Tests
on:
workflow_dispatch
jobs:
check-secrets:
runs-on: ubuntu-latest
outputs:
available: ${{ steps.check.outputs.available }}
steps:
- id: check
env:
KEY1: '${{ secrets.GW_MAINNET_V1_PK1 }}'
KEY2: '${{ secrets.GW_MAINNET_V1_PK2 }}'
if: ${{ env.KEY1 != '' && env.KEY2 != '' }}
run: echo "available=true" >> $GITHUB_OUTPUT
contract-tests:
runs-on: ubuntu-latest
needs: check-secrets
if: needs.check-secrets.outputs.available
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Node Cache
uses: actions/cache@v3
id: npm-and-yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.npm
key: ${{ runner.os }}-node_modules-${{ hashFiles('/home/runner/work/**/package-lock.json', '/home/runner/work/**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
working-directory: contracts
run: npm install
- name: Run tests on v1.mainnet.godwoken.io
working-directory: contracts
run: |
npm run test:gw_mainnet_v1
env:
PRIVATE_KEY: ${{ secrets.GW_MAINNET_V1_PK1 }}
PRIVATE_KEY2: ${{ secrets.GW_MAINNET_V1_PK2 }}
- name: Run tests on mainnet-readonly.godwoken.cf
working-directory: contracts
run: |
sed -i "s|v1.mainnet.godwoken.io|mainnet-readonly.godwoken.cf|g" hardhat.config.js
npm run test:gw_mainnet_v1
env:
PRIVATE_KEY: ${{ secrets.GW_MAINNET_V1_PK1 }}
PRIVATE_KEY2: ${{ secrets.GW_MAINNET_V1_PK2 }}