forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (67 loc) · 2.71 KB
/
e2e-compatibility-workflow-call.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
on:
workflow_call:
inputs:
test-file-directory:
description: 'Directory containing compatibility matrices'
required: true
type: string
test-suite:
description: 'Test suite to run'
required: true
type: string
jobs:
load-test-matrix:
outputs:
test-matrix: ${{ steps.set-test-matrix.outputs.test-matrix }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: andstor/file-existence-action@v2
with:
files: '.github/compatibility-test-matrices/${{ inputs.test-file-directory }}/${{ inputs.test-suite }}.json'
- run: |
# use jq -c to compact the full json contents into a single line. This is required when using the json body
# to create the matrix in the following job.
test_matrix="$(cat .github/compatibility-test-matrices/${{ inputs.test-file-directory }}/${{ inputs.test-suite }}.json | jq -c)"
echo "test-matrix=$test_matrix" >> $GITHUB_OUTPUT
id: set-test-matrix
e2e:
runs-on: ubuntu-latest
needs: load-test-matrix
# this job is skipped if the test-matrix generated is empty. i.e. if the file was not present.
# this allows us to not have to handle special case versions which may not have certain tests run against them.
if: needs.load-test-matrix.outputs.test-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.load-test-matrix.outputs.test-matrix) }}
steps:
- name: Checkout the ibc-go repo
uses: actions/checkout@v4
with:
repository: cosmos/ibc-go
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Run e2e Test
run: |
cd e2e
make e2e-test test=${{ matrix.test }}
env:
# each test has its own set of variables to specify which images are used.
# Note: this is significant as the standard behaviour when running e2es on PRs
# is that there is a set of env vars that are the same for each run. e.g. the same docker image is used
# for every test. With compatibility tests, each test may be running different combinations of images.
CHAIN_IMAGE: 'ghcr.io/cosmos/ibc-go-simd'
CHAIN_A_TAG: '${{ matrix.chain-a }}'
CHAIN_B_TAG: '${{ matrix.chain-b }}'
CHAIN_BINARY: 'simd'
RELAYER_ID: '${{ matrix.relayer-type }}'
- name: Upload Diagnostics
uses: actions/upload-artifact@v3
# we only want to upload logs on test failures.
if: ${{ failure() }}
continue-on-error: true
with:
name: '${{ matrix.entrypoint }}-${{ matrix.test }}'
path: e2e/diagnostics
retention-days: 5