-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (69 loc) · 3.1 KB
/
pr_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
62
63
64
65
66
67
68
69
70
71
name: PR tests
on:
pull_request:
branches:
- master
#TODO: remove push trigger
push: #temporary trigger tests this way
branches:
- '*'
jobs:
test_golang:
name: Run golang tests
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
GOBIN: ${{ github.workspace }}/bin
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/XDC-Subnet
strategy:
fail-fast: false
matrix:
include:
- name: A-B tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/[a-b].*")
- name: C-[a-m] tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/c[a-m].*")
- name: C-[n-o] tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/c[n-o].*")
- name: C-[p-z] tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/c[p-z].*")
- name: D-I tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/[d-i].*")
- name: J-N tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/[j-n].*")
- name: O-R tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/[o-r].*")
- name: S tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/s.*")
- name: T-Z tests
script: mv common/constants/constants.go.unittest common/constants.go; go run build/ci.go test -coverage $(go list ./... | grep "github.com/XinFinOrg/XDC-Subnet/[t-z].*")
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/XDC-Subnet
- name: Set up Go 1.21.x
uses: actions/setup-go@v4
with:
go-version: "1.21.x" # The Go version to download (if necessary) and use.
- name: Run tests
run: ${{ matrix.script }}
env:
GO111MODULE: auto
test_nodejs:
name: Run nodejs tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: Check smart contract
run: |
cd contracts/validator/src
yarn
npx hardhat test