forked from quicksilver-zone/quicksilver
-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (117 loc) · 3.68 KB
/
buildtest.yaml
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
# This is a basic workflow that is manually triggered
name: build and test
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
- develop
- unstable
- unstable-v1.5
# This workflow makes x86_64 for windows, and linux.
jobs:
build:
strategy:
matrix:
arch: [amd64]
targetos: [linux, windows, darwin]
include:
- targetos: darwin
arch: arm64
runs-on: ubuntu-latest
name: build quicksilver
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.20.5"
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Setup Golang caches
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Compile quicksilver
run: |
make install
- name: Archive quicksilver binaries
if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v3
with:
name: quicksilverd-${{ matrix.targetos }}-${{ matrix.arch }}
path: |
~/go/bin/quicksilverd*
test:
runs-on: ubuntu-latest
name: test quicksilver
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.20.5"
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Setup Golang caches
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-test-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-test-
- name: test quicksilver
run: |
make test-unit-cover
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
excludelist+=" $(find ./ -type f -path './test/*.go')"
excludelist+=" $(find ./ -type f -path './osmosis-types/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/ingenuity-build\/quicksilver/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
- name: "Go vulnerability checks"
continue-on-error: true
run: make vulncheck
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # needed for private repo
files: ./coverage.txt
flags: unittests
fail_ci_if_error: true
verbose: true
simulate:
if: contains(github.event.pull_request.labels.*.name, 'run-sim')
runs-on: ubuntu-latest
name: simulate quicksilver
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Run simulation tests
run: make test-sim-ci