-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracting e2e tests into two separate workflows (#1719)
- Loading branch information
Showing
3 changed files
with
147 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Tests / E2E Fork | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- docs/** | ||
jobs: | ||
# dynamically build a matrix of test/test suite pairs to run | ||
build-test-matrix: | ||
if: ${{ github.event.pull_request.head.repo.fork }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- id: set-matrix | ||
run: echo "::set-output name=matrix::$(go run .github/scripts/build_test_matrix.go)" | ||
|
||
e2e: | ||
env: | ||
SIMD_TAG: latest | ||
SIMD_IMAGE: ibc-go-simd-e2e | ||
if: ${{ github.event.pull_request.head.repo.fork }} | ||
needs: | ||
- build-test-matrix | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Docker Build | ||
run: docker build . -t "${SIMD_IMAGE}:${SIMD_TAG}" | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Run e2e Test | ||
run: | | ||
cd e2e | ||
make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Tests / E2E | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- docs/** | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ibc-go-simd-e2e | ||
|
||
jobs: | ||
docker-build: | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a | ||
with: | ||
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
# dynamically build a matrix of test/test suite pairs to run | ||
build-test-matrix: | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- id: set-matrix | ||
run: echo "::set-output name=matrix::$(go run .github/scripts/build_test_matrix.go)" | ||
|
||
|
||
# the tag of the image will differ if this is a PR or the branch is being merged into main. | ||
# we store the tag as an environment variable and use it in the E2E tests to determine the tag. | ||
determine-image-tag: | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
simd-tag: ${{ steps.get-tag.outputs.simd-tag }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- id: get-tag | ||
run: | | ||
tag=$(go run .github/scripts/determine_simd_tag.go -pr "${{ github.event.pull_request.number }}" ) | ||
echo "Using tag $tag" | ||
echo "::set-output name=simd-tag::$tag" | ||
e2e: | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-test-matrix | ||
- determine-image-tag | ||
- docker-build | ||
env: | ||
SIMD_TAG: ${{ needs.determine-image-tag.outputs.simd-tag }} | ||
SIMD_IMAGE: ghcr.io/cosmos/ibc-go-simd-e2e | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run e2e Test | ||
run: | | ||
cd e2e | ||
make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters