-
Notifications
You must be signed in to change notification settings - Fork 57
146 lines (127 loc) · 4.59 KB
/
e2e.yml
File metadata and controls
146 lines (127 loc) · 4.59 KB
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
136
137
138
139
140
141
142
143
144
145
146
name: Run End-To-End Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- frag/foundation
permissions:
contents: read
packages: write
jobs:
build-e2e-image:
name: Build E2E Image
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
# 1. Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# 2. Setup Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: false
# 3. Cache Go modules + build cache
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# 4. Pre-download deps (cached on host)
- name: Download Go dependencies
run: go mod download
# 5. Setup Docker Buildx with docker-container driver for cache mount support
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: |
network=host
# 6. Prepare Go module cache for Docker build
- name: Prepare Go module cache
run: |
mkdir -p .cache/go-mod
cp -r ~/go/pkg/mod/. .cache/go-mod/ 2>/dev/null || true
touch .cache/go-mod/.keep
# 7. Build E2E Docker image and push to registry
- name: Build and push e2e image
uses: docker/build-push-action@v5
with:
file: ./tests/e2e/e2e.Dockerfile
context: .
platforms: linux/amd64
tags: terra:debug
outputs: type=docker,dest=/tmp/terra-e2e-image.tar
build-args: |
BASE_IMG_TAG=debug
cache-from: type=gha
cache-to: type=gha,mode=max
# 8. Upload Docker image as artifact
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: terra-e2e-image
path: /tmp/terra-e2e-image.tar
retention-days: 1
e2e:
name: ${{ matrix.test }}
runs-on: ubuntu-latest
needs: build-e2e-image
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
test:
- TestIBCWasmHooks
- TestAddBurnTaxExemptionAddress
- TestFeeTax
- TestAuthz
- TestFeeTaxWasm
- TestAPIRegression
- TestOracleDelegateFeedConsent
steps:
# 1. Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# 2. Setup Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: false
# 3. Cache Go modules + build cache
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# 4. Pre-download deps (cached on host)
- name: Download Go dependencies
run: go mod download
# 5. Download Docker image artifact
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: terra-e2e-image
path: /tmp
# 6. Load Docker image
- name: Load Docker image
run: docker load -i /tmp/terra-e2e-image.tar
# 7. Run specific E2E test
- name: Run ${{ matrix.test }}
run: |
VERSION=$(git describe --tags --always) TERRA_E2E=True TERRA_E2E_DEBUG_LOG=True go test -mod=readonly -timeout=20m -v ./tests/e2e/... -run TestIntegrationTestSuite/${{ matrix.test }}