-
Notifications
You must be signed in to change notification settings - Fork 16
137 lines (120 loc) · 4.71 KB
/
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Tests
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
on:
push:
branches:
- master
- staging
pull_request:
jobs:
unit-test:
runs-on: [self-hosted, arc-runner]
# runs-on: ubuntu-20.04
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Clone ZWallet
uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt-get update
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
- name: Run Tests
run: make zwallet-test
build-linux:
runs-on: [self-hosted, arc-runner]
needs: unit-test
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Clone ZWallet
uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt-get update
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
- name: Build ZWallet
run: |
make install
system-tests:
if: github.event_name != 'workflow_dispatch'
needs: build-linux
runs-on: [ tests-suite ]
timeout-minutes: 120
steps:
- name: "Get current PR"
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
github-token: ${{ github.token }}
- name: "Setup Test Run"
run: |
echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV
echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV
echo "CURRENT_BRANCH=$(echo $(([ -z '${{ github.head_ref }}' ] && echo ${GITHUB_REF#refs/*/}) || echo '${{ github.head_ref }}'))" >> $GITHUB_ENV
- name: "Set PR status as pending"
uses: 0chain/actions/set-pr-status@master
if: steps.findPr.outputs.number
with:
pr_number: ${{ steps.findPr.outputs.pr }}
description: "System tests running with default config..."
state: "pending"
repository: ${{ github.repository }}
status_name: "0Chain System Tests"
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
github_token: ${{ github.token }}
- name: "Deploy 0Chain"
uses: 0chain/actions/deploy-0chain@master
with:
kube_config: ${{ secrets[format('DEV{0}KC', env.RUNNER_NUMBER)] }}
teardown_condition: "TESTS_PASSED"
miner_image: staging
sharder_image: staging
blobber_image: staging
validator_image: staging
zbox_image: staging
zblock_image: staging
zdns_image: staging
explorer_image: latest
zsearch_image: staging
zbox_cli_branch: staging
zwallet_cli_branch: ${{ env.CURRENT_BRANCH }}
SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }}
TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }}
graphnode_sc: ${{ secrets.GRAPHNODE_SC }}
graphnode_network: ${{ secrets.GRAPHNODE_NETWORK }}
graphnode_ethereum_node_url: https://rpc.tenderly.co/fork/${{ secrets.TENDERLY_FORK_ID }}
- name: "Run System tests"
uses: 0chain/actions/run-system-tests@master
with:
system_tests_branch: master
network: ${{ env.NETWORK_URL }}
zbox_cli_branch: staging
zwallet_cli_branch: ${{ env.CURRENT_BRANCH }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: false
archive_results: true
run_flaky_tests: false
retry_failures: true
TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }}
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run_smoke_tests: ${{ github.ref != 'refs/heads/staging' && github.base_ref != 'staging' && github.ref != 'refs/heads/master' && github.base_ref != 'master' }}
- name: "Set PR status as ${{ job.status }}"
if: ${{ (success() || failure()) && steps.findPr.outputs.number }}
uses: 0chain/actions/set-pr-status@master
with:
pr_number: ${{ steps.findPr.outputs.pr }}
description: "System tests with default config ${{ job.status }}"
state: ${{ job.status }}
repository: ${{ github.repository }}
status_name: "0Chain System Tests"
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
github_token: ${{ github.token }}