-
Notifications
You must be signed in to change notification settings - Fork 13
78 lines (60 loc) · 2.33 KB
/
staging-test-on-pr.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
name: Run tests against staging on PR
on:
pull_request:
branches: [main]
jobs:
staging-test:
runs-on: ubuntu-latest
environment: test # The below environment variables are only available in the test environment
env:
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
TEST_PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }}
TOKEN_CONTRACT: ${{ vars.TOKEN_CONTRACT }}
ORACLE_CONTRACT: ${{ vars.ORACLE_CONTRACT }}
ENDPOINT: ${{ vars.ENDPOINT }}
CHAIN_ENDPOINT: ${{ secrets.CHAIN_ENDPOINT }}
# On staging env, when test run it may not cleanup data properly for multiple reasons.
# In the next run, especially on pagination test, the assumption about data is wrong.
# For those kind of particular test, we want to ensure a 100% unique salt across run
# One way to do so, is get this run_id from github action and use it as salt
# On local dev, we just default to a hard code number in the test to isolate its. data
# on local test is continously wipe out on every run so it isn't a problem like staging
# We may want to sweep and delete task data on those test account
RUN_ID: ${{ github.run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Debug environment variables
run: |
echo "TOKEN_CONTRACT: $TOKEN_CONTRACT"
echo "ORACLE_CONTRACT: $ORACLE_CONTRACT"
echo "ENDPOINT: $ENDPOINT"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Test Authentication
run: yarn test:auth
- name: Test Create Workflow
run: yarn test:createWorkflow
- name: Test Get Workflow
run: yarn test:getWorkflow
- name: Test Get Workflows
run: yarn test:getWorkflows
- name: Test Cancel Workflow
run: yarn test:cancelWorkflow
- name: Test Delete Workflow
run: yarn test:deleteWorkflow
- name: Test Get Executions
run: yarn test:getExecutions
- name: Test Get Wallet
run: yarn test:getWallet
- name: Test Get Wallets
run: yarn test:getWallets
- name: Test Secret
run: yarn test:secret