-
Notifications
You must be signed in to change notification settings - Fork 616
74 lines (72 loc) · 2.88 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
70
71
72
73
74
on:
workflow_call:
inputs:
test-file:
description: 'The test file'
required: true
type: string
release-version:
description: 'the release tag, e.g. release-v7.3.0'
required: true
type: string
chain:
description: 'Should be one of chain-a, chain-b or all. Split up workflows into multiple (chain-a and chain-b) versions if the job limit is exceeded.'
required: false
type: string
default: all
jobs:
load-test-matrix:
outputs:
test-matrix: ${{ steps.set-test-matrix.outputs.test-matrix }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install -r requirements.txt
- 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="$(python scripts/generate-compatibility-json.py --file ${{ inputs.test-file }} --release-version ${{ inputs.release-version }} --chain ${{ inputs.chain }})"
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@v5
with:
go-version: '1.23'
cache-dependency-path: 'e2e/go.sum'
- 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_A_TAG: '${{ matrix.chain-a }}'
CHAIN_B_TAG: '${{ matrix.chain-b }}'
RELAYER_ID: '${{ matrix.relayer-type }}'
- name: Upload Diagnostics
uses: actions/upload-artifact@v4
# 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