From c646cf384b4da753bae845b54aea5d337dd6e0c6 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 09:56:33 +0100 Subject: [PATCH 1/6] chore: extracting e2e workflows into two separate ones, one for contributors and one for forks --- .github/workflows/e2e-fork.yml | 102 +++++++++++++++++++++++++++++++++ .github/workflows/e2e.yaml | 96 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 91 ----------------------------- 3 files changed, 198 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/e2e-fork.yml create mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml new file mode 100644 index 00000000000..55650d83213 --- /dev/null +++ b/.github/workflows/e2e-fork.yml @@ -0,0 +1,102 @@ +name: Tests / E2E Fork +on: + # pull_request_target workflows pass in all secrets. + # because of this, we guard executions of this workflow with the `safe-to-test` label + # as adding a label requires write access to the repo. + pull_request_target: + types: [labeled] + branches: + - main + paths-ignore: + - docs/** + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ibc-go-simd-e2e + +jobs: + docker-build: + if: contains(github.event.pull_request.labels.*.name, 'safe-to-test') + 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: + 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: + 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: + 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 }} diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 00000000000..518ec8ccf89 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,96 @@ +name: Tests / E2E +on: + pull_request: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ibc-go-simd-e2e + +jobs: + docker-build: + 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: + 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: + 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: + 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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4f4e721539..1164a1a1c22 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,10 +7,6 @@ on: branches: - main -env: - REGISTRY: ghcr.io - IMAGE_NAME: ibc-go-simd-e2e - jobs: cleanup-runs: runs-on: ubuntu-latest @@ -159,90 +155,3 @@ jobs: with: file: ./coverage.txt if: env.GIT_DIFF - - - docker-build: - 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: - 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: - 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: - 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 }} From 93db7b07ae5868c9e052e239dca7f7de5c1f0cbf Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 10:16:09 +0100 Subject: [PATCH 2/6] chore: using local docker registry --- .github/workflows/e2e.yaml | 48 +++++++------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 518ec8ccf89..76a206fd446 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -14,26 +14,13 @@ jobs: 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: Setup Container Registry + run: | + docker run -d -p 5000:5000 --name registry-test registry:2 + - name: Docker Build & Push + run: | + docker build . -t localhost:5000/ibc-go-simd-e2e:latest - - 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: @@ -49,33 +36,14 @@ jobs: 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: - 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: 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 + SIMD_TAG: latest + SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e strategy: fail-fast: false matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} From c423c7b7a718c49323532c56db2f6fa325ecedf9 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 10:23:11 +0100 Subject: [PATCH 3/6] chore: correcting workflow files --- .github/workflows/e2e-fork.yml | 68 +++++----------------------------- .github/workflows/e2e.yaml | 50 +++++++++++++++++++++---- 2 files changed, 51 insertions(+), 67 deletions(-) diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index 55650d83213..641929b7efb 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -1,45 +1,21 @@ name: Tests / E2E Fork on: - # pull_request_target workflows pass in all secrets. - # because of this, we guard executions of this workflow with the `safe-to-test` label - # as adding a label requires write access to the repo. - pull_request_target: - types: [labeled] + pull_request: branches: - main paths-ignore: - docs/** - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ibc-go-simd-e2e - jobs: docker-build: - if: contains(github.event.pull_request.labels.*.name, 'safe-to-test') 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 }} + - name: Setup Local Container Registry + run: docker run -d -p 5000:5000 --name registry-test registry:2 + - name: Docker Build & Push + run: | + docker build . -t localhost:5000/ibc-go-simd-e2e:latest + docker push localhost:5000/ibc-go-simd-e2e:latest # dynamically build a matrix of test/test suite pairs to run build-test-matrix: @@ -54,34 +30,14 @@ jobs: - 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: - 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: 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 + SIMD_TAG: latest + SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e strategy: fail-fast: false matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} @@ -90,12 +46,6 @@ jobs: - 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 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 76a206fd446..6f376e7b916 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -4,6 +4,8 @@ on: push: branches: - main + paths-ignore: + - docs/** env: REGISTRY: ghcr.io @@ -14,13 +16,26 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Setup Container Registry - run: | - docker run -d -p 5000:5000 --name registry-test registry:2 - - name: Docker Build & Push - run: | - docker build . -t localhost:5000/ibc-go-simd-e2e:latest + - 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: @@ -36,14 +51,33 @@ jobs: 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: + 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: runs-on: ubuntu-latest needs: - build-test-matrix + - determine-image-tag - docker-build env: - SIMD_TAG: latest - SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e + 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) }} From 8ca591cedf65579817bcdc063fa33ff5f5a10af8 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 10:40:20 +0100 Subject: [PATCH 4/6] chore: moving build and push to test matrix --- .github/workflows/e2e-fork.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index 641929b7efb..ac27063959d 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -6,17 +6,6 @@ on: paths-ignore: - docs/** jobs: - docker-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Local Container Registry - run: docker run -d -p 5000:5000 --name registry-test registry:2 - - name: Docker Build & Push - run: | - docker build . -t localhost:5000/ibc-go-simd-e2e:latest - docker push localhost:5000/ibc-go-simd-e2e:latest - # dynamically build a matrix of test/test suite pairs to run build-test-matrix: runs-on: ubuntu-latest @@ -31,22 +20,28 @@ jobs: run: echo "::set-output name=matrix::$(go run .github/scripts/build_test_matrix.go)" e2e: - runs-on: ubuntu-latest needs: - build-test-matrix - - docker-build - env: - SIMD_TAG: latest - SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e + runs-on: ubuntu-latest strategy: fail-fast: false matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - name: Setup Local Container Registry + run: docker run -d -p 5000:5000 --name registry-test registry:2 + - name: Docker Build & Push + run: | + docker build . -t localhost:5000/ibc-go-simd-e2e:latest + docker push localhost:5000/ibc-go-simd-e2e:latest + - name: Setup Go + uses: actions/setup-go@v3 with: go-version: 1.18 - name: Run e2e Test + env: + SIMD_TAG: latest + SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e run: | cd e2e make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} From d17c9b907647e51c5b64313ae50f97bdc2ef94c6 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 10:46:33 +0100 Subject: [PATCH 5/6] chore: skipping creation of local registry --- .github/workflows/e2e-fork.yml | 12 +++++++----- .github/workflows/e2e.yaml | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index ac27063959d..d6b635b94d1 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -8,6 +8,7 @@ on: 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 }} @@ -20,6 +21,7 @@ jobs: run: echo "::set-output name=matrix::$(go run .github/scripts/build_test_matrix.go)" e2e: + if: ${{ github.event.pull_request.head.repo.fork }} needs: - build-test-matrix runs-on: ubuntu-latest @@ -28,12 +30,12 @@ jobs: matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v3 - - name: Setup Local Container Registry - run: docker run -d -p 5000:5000 --name registry-test registry:2 +# - name: Setup Local Container Registry +# run: docker run -d -p 5000:5000 --name registry-test registry:2 - name: Docker Build & Push run: | - docker build . -t localhost:5000/ibc-go-simd-e2e:latest - docker push localhost:5000/ibc-go-simd-e2e:latest + docker build . -t ibc-go-simd-e2e:latest +# docker push localhost:5000/ibc-go-simd-e2e:latest - name: Setup Go uses: actions/setup-go@v3 with: @@ -41,7 +43,7 @@ jobs: - name: Run e2e Test env: SIMD_TAG: latest - SIMD_IMAGE: localhost:5000/ibc-go-simd-e2e + SIMD_IMAGE: ibc-go-simd-e2e run: | cd e2e make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 6f376e7b916..787559f18f3 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -13,6 +13,7 @@ env: jobs: docker-build: + if: ${{ !github.event.pull_request.head.repo.fork }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -39,6 +40,7 @@ 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 }} @@ -54,6 +56,7 @@ jobs: # 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 }} @@ -70,6 +73,7 @@ jobs: e2e: + if: ${{ !github.event.pull_request.head.repo.fork }} runs-on: ubuntu-latest needs: - build-test-matrix From aff659600cad32bd2dcc6e416c5fc6b8f749560f Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Mon, 18 Jul 2022 10:54:09 +0100 Subject: [PATCH 6/6] chore: simplifying e2e-fork.yml --- .github/workflows/e2e-fork.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index d6b635b94d1..c7add63f323 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -21,6 +21,9 @@ jobs: 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 @@ -30,20 +33,13 @@ jobs: matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v3 -# - name: Setup Local Container Registry -# run: docker run -d -p 5000:5000 --name registry-test registry:2 - - name: Docker Build & Push - run: | - docker build . -t ibc-go-simd-e2e:latest -# docker push localhost:5000/ibc-go-simd-e2e:latest + - 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 - env: - SIMD_TAG: latest - SIMD_IMAGE: ibc-go-simd-e2e run: | cd e2e make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }}