forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (104 loc) · 3.41 KB
/
tm2.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
name: tm2
on:
pull_request:
paths:
# XXX: for now keep the paths for gnovm, tm2, gnoland and misc the same,
# so that coverage information is uploaded for all of them together.
# This could be removed in the future.
- "gnovm/**"
- "tm2/**"
- "gno.land/**"
- "misc/**"
- "examples/**"
- ".github/workflows/**"
# XXX: end copied part, below is the "ideal" paths on which this workflow should run
- "go.sum"
- "tm2/Makefile"
- "tm2/**.go"
- ".github/workflows/tm2.yml"
push:
branches: [ "master" ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
goarch: [ "amd64" ]
goos: [ "linux" ]
program: [ "./pkg/amino/cmd/aminoscan", "./pkg/amino/cmd/goscan", "./pkg/autofile/cmd", "./pkg/iavl/cmd/iaviewer" ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- name: go install
working-directory: tm2
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ${{ matrix.program }}
test:
strategy:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
args:
- _test.flappy
- _test.pkg.amino
- _test.pkg.bft
- _test.pkg.others
# _test.pkg.db needs special dependencies -- see db-tests.
runs-on: ubuntu-latest
timeout-minutes: 21
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- name: Set environment variables for debug mode
if: ${{ runner.debug == 1 }}
run: |
export LOG_PATH_DIR=${{ runner.temp }}/logs-go${{ matrix.goversion }}-${{ matrix.args }}
mkdir -p $LOG_PATH_DIR
echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
- name: test
working-directory: tm2
run: |
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=20m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
touch coverage.out
- uses: actions/upload-artifact@v4
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.22.x' }}
with:
name: ${{runner.os}}-coverage-tm2-${{ matrix.args}}-${{matrix.goversion}}
path: ./tm2/coverage.out
- name: Upload Debug Logs
uses: actions/upload-artifact@v4
if: ${{ always() && runner.debug == 1 }}
with:
name: logs-test-go${{ matrix.goversion }}-${{ matrix.args }}
path: ${{ env.LOG_PATH_DIR }}/**/*
upload-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all previous coverage artifacts
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/coverage
- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ${{ runner.temp }}/coverage
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}