Skip to content

Commit

Permalink
ci: update workflow fork conditions to allow run on copies (#6783)
Browse files Browse the repository at this point in the history
* ci: update workflow fork conditions to allow run on copies

* ci: update concurrency opts for e2e and e2e-fork workflows

* chore: adding filter to wasm tests

* chore: add comment to e2e fork workflow

---------

Co-authored-by: chatton <cian@interchain.io>
  • Loading branch information
damiannolan and chatton authored Jul 9, 2024
1 parent e76766a commit 604031f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/e2e-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ on:

# cancel workflows if a new one is triggered on the same branch.
concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
# dynamically build a matrix of test/test suite pairs to run
build-test-matrix:
if: ${{ github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
# run this job on forks and copies of ibc-go, for example: a public fork or a private copy of ibc-go.
if: ${{ github.repository != 'cosmos/ibc-go' || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -35,7 +36,8 @@ jobs:

# dynamically build a matrix of test/test suite pairs to run
build-test-matrix-wasm:
if: ${{ github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
# run this job on forks and copies of ibc-go, for example: a public fork or a private copy of ibc-go.
if: ${{ github.repository != 'cosmos/ibc-go' || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -59,7 +61,8 @@ jobs:
CHAIN_IMAGE: ibc-go-simd
RELAYER_ID: "hermes" # by default use hermes for fork e2es.
FORK: "true"
if: ${{ github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
# run this job on forks and copies of ibc-go, for example: a public fork or a private copy of ibc-go.
if: ${{ github.repository != 'cosmos/ibc-go' || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
needs:
- build-test-matrix
runs-on: ubuntu-latest
Expand Down Expand Up @@ -88,7 +91,8 @@ jobs:
# CHAIN_IMAGE: ibc-go-wasm-simd
# RELAYER_ID: "hyperspace" # by default use hyperspace relayer for fork wasm tests.
# FORK: "true"
# if: ${{ github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
# run this job on forks and copies of ibc-go, for example: a public fork or a private copy of ibc-go.
# if: ${{ github.repository != 'cosmos/ibc-go' || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }}
# needs: build-test-matrix-wasm
# runs-on: ubuntu-latest
# strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:

# cancel workflows if a new one is triggered on the same branch.
concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ on:
- 'LICENSE'
# cancel workflows if a new one is triggered on the same branch.
concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
# determine-image-tag will either output the PR number e.g. pr-1234 or the string main.
# this will be used to tag the images that are built during the workflow.
determine-image-tag:
if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
if: ${{ !github.event.pull_request.draft && github.repository == 'cosmos/ibc-go' && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
outputs:
simd-tag: ${{ steps.get-tag.outputs.simd-tag }}
Expand All @@ -50,7 +50,7 @@ jobs:
e2e:
# we will be running this job if the PR has not yet been marked for review, and we push additional changes.
# we skip the job in this case.
if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
if: ${{ !github.event.pull_request.draft && github.repository == 'cosmos/ibc-go' && github.actor != 'dependabot[bot]' }}
needs: determine-image-tag # we are required to have a docker tag before we can build any images.
uses: ./.github/workflows/e2e-test-workflow-call.yml
# unless we explicitly tell the workflow to inherit secrets, required secrets such as GITHUB_TOKEN will not be
Expand Down

0 comments on commit 604031f

Please sign in to comment.