Skip to content

Commit

Permalink
[TT-974] Chainlink-evm workflow dispatch updates (#12457)
Browse files Browse the repository at this point in the history
* Add run solana input to e2e workflow

* Add core workflow dispatch

* Add a run name with a distinct id

* Fix concurrency issues

* add input for setting the filter outputs to true for dispatch to avoid the filter

* Remove input for setting the output, instead switch off the github event
  • Loading branch information
tateexon authored Mar 18, 2024
1 parent 30b73a8 commit 331c1cb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 29 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: CI Core
run-name: CI Core ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.distinct_run_name }}
cancel-in-progress: true

# Run on key branches to make sure integration is good, otherwise run on all PR's
Expand All @@ -15,6 +16,17 @@ on:
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
distinct_run_name:
description: 'A unique identifier for this run, used when running from other repos'
required: false
type: string
evm-ref:
description: The chainlink-evm reference to use when testing against a specific version for compatibliity
required: false
default: ""
type: string

jobs:

Expand All @@ -23,7 +35,7 @@ jobs:
permissions:
pull-requests: read
outputs:
changes: ${{ steps.changes.outputs.changes }}
changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.changes }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
Expand All @@ -36,6 +48,10 @@ jobs:
filters: |
changes:
- '!integration-tests/**'
- name: Ignore Filter On Workflow Dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
id: ignore-filter
run: echo "changes=true" >> $GITHUB_OUTPUT

golangci:
# We don't directly merge dependabot PRs, so let's not waste the resources
Expand Down Expand Up @@ -102,6 +118,10 @@ jobs:
- name: Download Go vendor packages
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go mod download
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-evm@${{ inputs.evm-ref }}
- name: Build binary
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go build -o chainlink.test .
Expand Down Expand Up @@ -209,6 +229,10 @@ jobs:
- name: Download Go vendor packages
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go mod download
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-evm@${{ inputs.evm-ref }}
- name: Build binary
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go build -o chainlink.test .
Expand Down
42 changes: 15 additions & 27 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Integration Tests
run-name: Integration Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }}
on:
merge_group:
pull_request:
Expand All @@ -11,40 +12,23 @@ on:
description: 'The ref to checkout, defaults to the calling branch'
required: false
type: string
dep_evm_sha:
evm-ref:
description: 'The sha of the chainlink-evm commit to use if wanted'
required: false
type: string
set_changes_output:
description: 'Set the changes output'
required: false
type: string
default: 'true'
workflow_call:
inputs:
cl_ref:
description: 'The ref to checkout'
required: false
type: string
default: 'develop'
dep_evm_sha:
description: 'The sha of the chainlink-evm commit to use if wanted'
required: false
type: string
set_changes_output:
description: 'Set the changes output'
required: false
type: string
default: 'true'
run_solana:
description: 'Run solana tests'
required: false
type: string
default: 'false'
distinct_run_name:
description: 'A unique identifier for this run, only use from other repos'
required: false
type: string

# Only run 1 of this workflow at a time per PR
concurrency:
group: integration-tests-chainlink-${{ github.ref }}
group: integration-tests-chainlink-${{ github.ref }}-${{ inputs.distinct_run_name }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -107,14 +91,18 @@ jobs:
id: changes
with:
filters: |
src:
changes:
- '**/*.go'
- '**/*go.sum'
- '**/*go.mod'
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/config/**/*.toml'
- 'integration-tests/**/*.toml'
- name: Ignore Filter On Workflow Dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
id: ignore-filter
run: echo "changes=true" >> $GITHUB_OUTPUT
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand All @@ -126,7 +114,7 @@ jobs:
this-job-name: Check Paths That Require Tests To Run
continue-on-error: true
outputs:
src: ${{ inputs.set_changes_output || steps.changes.outputs.src }}
src: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.changes }}

build-lint-integration-tests:
name: Build and Lint integration-tests
Expand Down Expand Up @@ -214,7 +202,7 @@ jobs:
git_commit_sha: ${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
dep_evm_sha: ${{ inputs.dep_evm_sha }}
dep_evm_sha: ${{ inputs.evm-ref }}

build-test-image:
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'schedule' || contains(join(github.event.pull_request.labels.*.name, ' '), 'build-test-image')
Expand Down Expand Up @@ -390,7 +378,7 @@ jobs:
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6

eth-smoke-tests-matrix-log-poller:
if: ${{ !(contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') || github.event_name == 'workflow_dispatch') }}
if: ${{ !(contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') || github.event_name == 'workflow_dispatch') || inputs.distinct_run_name != '' }}
environment: integration
permissions:
checks: write
Expand Down

0 comments on commit 331c1cb

Please sign in to comment.