-
Notifications
You must be signed in to change notification settings - Fork 381
103 lines (100 loc) · 3.05 KB
/
examples.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
name: examples
on:
pull_request:
push:
branches: [ "master" ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
gno2go:
strategy:
fail-fast: false
matrix:
goversion:
- "1.22.x"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno transpile -v --gobuild ./examples
test:
strategy:
fail-fast: false
matrix:
goversion:
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- name: Set environment variables for debug mode
if: env.ACTIONS_STEP_DEBUG == 'true'
run: |
export LOG_PATH_DIR=${{ runner.temp }}/logs
mkdir -p $LOG_PATH_DIR
echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno test -v ./examples/...
lint:
strategy:
fail-fast: false
matrix:
goversion:
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
# testing official directories, basically examples/ minus examples/.../x/.
- run: make lint -C ./examples
# TODO: consider running lint on every other directories, maybe in "warning" mode?
# TODO: track coverage
fmt:
strategy:
fail-fast: false
matrix:
goversion: [ "1.22.x" ]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- run: |
make fmt -C ./examples
# Check if there are changes after running make fmt
git diff --exit-code || (echo "Some gno files are not formatted, please run 'make fmt'." && exit 1)
mod-tidy:
strategy:
fail-fast: false
matrix:
go-version: [ "1.22.x" ]
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- run: |
GNO_CMD="$(pwd)/gnovm/cmd/gno"
# Find all directories containing gno.mod file
find ./examples -name "gno.mod" -execdir go run "$GNO_CMD" mod tidy \;
# Check if there are changes after running gno mod tidy
git diff --exit-code || (echo "Some gno.mod files are not tidy, please run 'make tidy'." && exit 1)