Skip to content

Commit

Permalink
Support full compatibility test runs through a GitHub action (cosmos#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chatton authored Sep 22, 2022
1 parent 482b834 commit b859d7f
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/compatibility-test-matrices/release-v5.0.x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"include": [
{
"chain-binary": "simd",
"chain-a-tag": "release-v5.0.x",
"chain-b-tag": "release-v5.0.x",
"chain-image": "ghcr.io/cosmos/ibc-go-simd",
"entrypoint": "TestTransferTestSuite",
"test": "TestReceiveEnabledParam"
}
]
}
88 changes: 88 additions & 0 deletions .github/workflows/e2e-compatibility.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Compatibility E2E
on:
workflow_dispatch:
release-branch:
description: 'Release branch to test'
required: true
type: choice
options:
- release/v5.0.x

env:
REGISTRY: ghcr.io
ORG: cosmos
IMAGE_NAME: ibc-go-simd
RELEASE_BRANCH: '${{ inputs.release-branch }}'

jobs:
determine-docker-tag:
runs-on: ubuntu-latest
outputs:
docker-tag: ${{ steps.set-docker-tag.outputs.docker-tag }}
steps:
- run: |
docker_tag="$(echo $RELEASE_BRANCH | sed 's/\//-/')"
echo $docker_tag
echo "::set-output name=docker-tag::$docker_tag"
id: set-docker-tag
build-release-image:
runs-on: ubuntu-latest
needs: determine-docker-tag
steps:
- uses: actions/checkout@v3
with:
ref: "${{ env.RELEASE_BRANCH }}"
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch latest Dockerfile
run: curl https://raw.githubusercontent.com/cosmos/ibc-go/main/Dockerfile -o Dockerfile
- name: Build image
run: |
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
load-test-matrix:
outputs:
test-matrix: ${{ steps.set-test-matrix.outputs.test-matrix }}
needs: determine-docker-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
# use jq -c to put the full json contents on 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/${{ needs.determine-docker-tag.outputs.docker-tag }}.json | jq -c)"
echo $test_matrix
echo "::set-output name=test-matrix::$test_matrix"
id: set-test-matrix
e2e-tests:
runs-on: ubuntu-latest
needs:
- load-test-matrix
- build-release-image
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.load-test-matrix.outputs.test-matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run e2e Test
run: |
cd e2e
make e2e-test entrypoint=${{ matrix.entrypoint }} test=${{ matrix.test }}
env:
# each test has its own set of variables to specify which images are used.
CHAIN_IMAGE: "${{ matrix.chain-image }}"
CHAIN_A_TAG: "${{ matrix.chain-a-tag }}"
CHAIN_B_TAG: "${{ matrix.chain-b-tag }}"
CHAIN_BINARY: "${{ matrix.chain-binary }}"
RLY_TAG: "v2.0.0"

0 comments on commit b859d7f

Please sign in to comment.