-
Notifications
You must be signed in to change notification settings - Fork 49
88 lines (73 loc) · 2.38 KB
/
e2e-tests.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
name: End to End Tests
on:
pull_request:
env:
TAR_PATH: heighliner.tar
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Build Docker image
uses: strangelove-ventures/heighliner-build-action@v1.0.2
with:
registry: "" # empty registry, image only shared for e2e testing
tag: local # emulate local environment for consistency in e2e cases
tar-export-path: ${{ env.TAR_PATH }} # export a tarball that can be uploaded as an artifact for the e2e jobs
platform: linux/amd64 # test runner architecture only
git-ref: ${{ github.head_ref }} # source code ref
# Heighliner chains.yaml config
chain: noble
dockerfile: cosmos
build-target: make install
binaries: |
- /go/bin/nobled
- name: Publish Tarball as Artifact
uses: actions/upload-artifact@v4
with:
name: noble-docker-image
path: ${{ env.TAR_PATH }}
prepare-e2e-tests:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22'
- name: Generate matrix
id: set-matrix
run: |
# Run the command and convert its output to a JSON array
TESTS=$(cd e2e && go test -list . | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT
e2e-tests:
needs:
- build-docker
- prepare-e2e-tests
runs-on: ubuntu-latest
strategy:
matrix:
# names of `make` commands to run tests
test: ${{fromJson(needs.prepare-e2e-tests.outputs.matrix)}}
fail-fast: false
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22'
- name: checkout chain
uses: actions/checkout@v4
- name: Download Tarball Artifact
uses: actions/download-artifact@v4
with:
name: noble-docker-image
- name: Load Docker Image
run: docker image load -i ${{ env.TAR_PATH }}
- name: run test
run: cd e2e && go test -race -v -timeout 30m -run ^${{ matrix.test }}$ .