-
Notifications
You must be signed in to change notification settings - Fork 27
135 lines (133 loc) · 4.94 KB
/
ci.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
name: ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 1 * * 1' # At 01:00 on Monday
workflow_dispatch:
jobs:
ci:
strategy:
fail-fast: false
matrix:
ci_step: [
"lint",
"test",
"integration tests coreum-modules",
"integration tests coreum-ibc",
"integration tests coreum-upgrade-v3.0.0",
"integration tests faucet",
]
include:
- ci_step: "lint"
command: "crust lint/coreum"
go-cache: true
wasm-cache: true
linter-cache: true
docker-cache: false
- ci_step: "test"
command: "crust test/coreum"
go-cache: true
wasm-cache: false
linter-cache: false
docker-cache: false
- ci_step: "integration tests coreum-modules"
command: "crust build/integration-tests/coreum/modules images && crust znet test --test-groups=coreum-modules --timeout-commit 0.5s"
go-cache: true
wasm-cache: true
linter-cache: false
docker-cache: true
- ci_step: "integration tests coreum-ibc"
command: "crust build/integration-tests/coreum/ibc images && crust znet test --test-groups=coreum-ibc --timeout-commit 1s"
go-cache: true
wasm-cache: true
linter-cache: false
docker-cache: true
- ci_step: "integration tests coreum-upgrade-v3.0.0"
command: |
crust build/integration-tests/coreum/upgrade build/integration-tests/coreum/modules build/integration-tests/coreum/ibc images
crust znet test --cored-version=v2.0.2 --test-groups=coreum-upgrade,coreum-modules,coreum-ibc --timeout-commit 1s
go-cache: true
wasm-cache: true
linter-cache: false
docker-cache: true
- ci_step: "integration tests faucet"
command: "crust build/integration-tests/faucet images && crust znet test --test-groups=faucet --timeout-commit 1s"
go-cache: true
wasm-cache: false
linter-cache: false
docker-cache: true
runs-on: ubuntu-22.04
steps:
- name: Go version used to build crust tool
run: go version
- name: Checkout coreum
uses: actions/checkout@v3
with:
persist-credentials: false
path: coreum
- name: Checkout crust
uses: actions/checkout@v3
with:
repository: CoreumFoundation/crust
path: crust
- name: Set up crust
run: echo "$(pwd)/crust/bin" >> $GITHUB_PATH
- name: Setup go cache
uses: actions/cache@v3
if: ${{ matrix.go-cache }}
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Setup WASM cache
uses: actions/cache@v3
if: ${{ matrix.wasm-cache }}
with:
# we need to exclude code-hashes.json from the rest, since the invalidation condition for it is not
# same as WASM cache, but it is same as smart contract artifacts.
path: |
~/.cache/crust/wasm
!/.cache/crust/wasm/code-hashes.json
key: ${{ runner.os }}-wasm-cache-${{ hashFiles('~/.cache/crust/wasm/**/*.rs') }}
- name: Setup linter cache
uses: actions/cache@v3
if: ${{ matrix.linter-cache }}
with:
path: ~/.cache/golangci-lint
key: ${{ runner.os }}-linter-cache-3
- name: Get Date
id: get-year-week
run: |
echo "date=$(/bin/date -u "+%Y-%U")" >> $GITHUB_OUTPUT
shell: bash
- name: Set docker cache
uses: satackey/[email protected]
if: ${{ matrix.docker-cache }}
continue-on-error: true
with:
key: ${{ runner.os }}-docker-v2-${{ steps.get-year-week.outputs.date }} # year-week key
- name: Set crust binaries cache
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.cache/crust/bin
key: ${{ runner.os }}-bin-${{ steps.get-year-week.outputs.date }} # year-week key
- name: Setup smart contract build cache
uses: actions/cache@v3
with:
# we need to cache code-hashes.json under the same key as the artifacts, since the invalidation condition
# for both of them are the same.
path: |
${{ github.workspace }}/coreum/integration-tests/contracts/**/artifacts/*
~/.cache/crust/wasm/code-hashes.json
key: ${{ runner.os }}-cache-smart-contracts-${{ hashFiles('./coreum/**/*.rs') }}
if: ${{ matrix.wasm-cache }}
- name: Run ${{ matrix.ci_step }}
run: ${{ matrix.command }}
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2