-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracting e2e tests into two separate workflows #1719
Changes from all commits
c646cf3
93db7b0
c423c7b
8ca591c
d17c9b9
aff6596
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Tests / E2E | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. everything in this file was just moved from |
||
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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I won't be able to verify this until the PR is merged unfortunately. I'll keep an eye on the action and create a fix if there are any issues. |
||
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 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a fork-only workflow that will build and run the test locally to the host. There is no interaction with our ghcr registries.