Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
Browse files Browse the repository at this point in the history
…NONEVM-935/implement-ccip-solana-plugin-codec
  • Loading branch information
huangzhen1997 committed Jan 3, 2025
2 parents d2a7a39 + 945c706 commit ae3e43c
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 178 deletions.
8 changes: 4 additions & 4 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ runs:
# If multiple jobs call actions/cache, then only one will get priority to create upon a cache miss.
# We will only restore the cache by default (by calling actions/cache/restore) and let the
# `go-mod-cache.yml` workflow handle the creation.
- uses: actions/cache/restore@v4.1.1
- uses: actions/cache/restore@v4
if: ${{ inputs.restore-module-cache-only == 'true' }}
name: Cache Go Modules
with:
Expand All @@ -83,7 +83,7 @@ runs:
# If this is called, then it will create the cache entry upon a cache miss.
# The cache is created after a cache miss, and after job completes successfully.
- uses: actions/cache@v4.1.1
- uses: actions/cache@v4
if: ${{ inputs.restore-module-cache-only != 'true' }}
name: Cache Go Modules
with:
Expand All @@ -95,7 +95,7 @@ runs:
restore-keys: |
${{ runner.os }}-gomod-${{ inputs.cache-version }}-
- uses: actions/cache/restore@v4.1.1
- uses: actions/cache/restore@v4
name: Cache Go Build Outputs (restore)
# For certain events, we don't necessarily want to create a build cache, but we will benefit from restoring from one.
if: ${{ inputs.only-modules == 'false' && (github.event_name == 'merge_group' || inputs.restore-build-cache-only == 'true') }}
Expand All @@ -109,7 +109,7 @@ runs:
${{ runner.os }}-gobuild-${{ inputs.build-cache-version || inputs.cache-version }}-
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-
- uses: actions/cache@v4.1.1
- uses: actions/cache@v4
# don't save cache on merge queue events
if: ${{ inputs.only-modules == 'false' && (github.event_name != 'merge_group' && inputs.restore-build-cache-only == 'false') }}
name: Cache Go Build Outputs
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-hardhat/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ runs:
using: composite
steps:
- name: Cache Compilers
uses: actions/cache@v4.1.1
uses: actions/cache@v4
with:
path: ~/.cache/hardhat-nodejs/
key: contracts-compilers-${{ runner.os }}-${{ inputs.cache-version }}-${{ hashFiles('contracts/pnpm-lock.yaml', 'contracts/hardhat.config.ts') }}

- name: Cache contracts build outputs
uses: actions/cache@v4.1.1
uses: actions/cache@v4
with:
path: |
contracts/cache/
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-solana/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/cache@v4.1.1
- uses: actions/cache@v4
id: cache
name: Cache solana CLI
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-wasmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/cache@v4.1.1
- uses: actions/cache@v4
id: cache
name: Cache wasmd-build
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-publish-develop-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
role-session-name: "split-${{ matrix.goarch }}"

- id: cache
uses: actions/cache@v4.1.1
uses: actions/cache@v4
with:
path: dist/${{ matrix.dist_name }}
key: chainlink-${{ matrix.goarch }}-${{ github.sha }}
Expand Down Expand Up @@ -142,13 +142,13 @@ jobs:
mask-aws-account-id: true
role-session-name: "merge"

- uses: actions/cache/restore@v4.1.1
- uses: actions/cache/restore@v4
with:
path: dist/linux_amd64_v1
key: chainlink-amd64-${{ github.sha }}
fail-on-cache-miss: true

- uses: actions/cache/restore@v4.1.1
- uses: actions/cache/restore@v4
with:
path: dist/linux_arm64_v8.0
key: chainlink-arm64-${{ github.sha }}
Expand Down
189 changes: 23 additions & 166 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,34 @@ on:
pull_request:
schedule:
- cron: "0 0,6,12,18 * * *"
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:
filter:
name: Detect Changes
permissions:
pull-requests: read
outputs:
affected-packages: ${{ steps.resolved-modules.outputs.module_names }}
affected-modules: ${{ steps.resolved-modules.outputs.module_names }}
deployment-changes: ${{ steps.match-some.outputs.deployment == 'true' }}
scripts-changes: ${{ steps.match-some.outputs.scripts == 'true' }}
should-run-ci-core: ${{ steps.match-some.outputs.core-ci == 'true' || steps.match-every.outputs.non-ignored == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
should-run-golangci: ${{ steps.match-some.outputs.golang-ci == 'true' || steps.match-every.outputs.non-ignored == 'true' || github.event_name == 'workflow_dispatch' }}
should-run-ci-core: >-
${{
steps.match-some.outputs.core-ci == 'true' ||
steps.match-every.outputs.non-ignored == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
should-run-golangci: >-
${{
steps.match-some.outputs.golang-ci == 'true' ||
steps.match-every.outputs.non-ignored == 'true'
}}
should-run-scripts-test: >-
${{
steps.match-some.outputs.scripts == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
Expand Down Expand Up @@ -126,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
modules: ${{ fromJson(needs.filter.outputs.affected-packages) }}
modules: ${{ fromJson(needs.filter.outputs.affected-modules) }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.1
Expand All @@ -151,8 +156,6 @@ jobs:
golangci-matrix-results-validation:
name: lint
needs: [golangci]
# We don't directly merge dependabot PRs to not waste the resources.
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Check Golangci-lint Matrix Results
Expand Down Expand Up @@ -217,13 +220,6 @@ jobs:
restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_fuzz' }}
build-cache-version: ${{ matrix.type.cmd }}

- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' && inputs.evm-ref != ''}}
env:
GH_INPUTS_EVM_REF: ${{ inputs.evm-ref }}
shell: bash
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@$GH_INPUTS_EVM_REF

- name: Setup Solana
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-solana
Expand Down Expand Up @@ -336,7 +332,7 @@ jobs:
name: test-scripts
needs: [filter]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' || needs.filter.outputs.scripts-changes == 'true' }}
if: ${{ needs.filter.outputs.should-run-scripts-test == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.1
Expand All @@ -353,7 +349,7 @@ jobs:
run: ./tools/bin/go_core_scripts_tests ./...

- name: Store test report artifacts
if: ${{ always() && needs.filter.outputs.should-run-ci-core == 'true' }}
if: ${{ always() }}
uses: actions/upload-artifact@v4.4.3
with:
name: go_core_scripts_tests_logs
Expand All @@ -362,98 +358,6 @@ jobs:
./coverage.txt
retention-days: 7

detect-flakey-tests:
needs: [filter, core, core-scripts-tests]
name: Flakey Test Detection
runs-on: ubuntu-latest
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
env:
CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
permissions:
id-token: write
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@v4.2.1
with:
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v4.0.4

- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
with:
prod: "true"

- name: Setup Go
uses: ./.github/actions/setup-go

- name: Setup Postgres
uses: ./.github/actions/setup-postgres

- name: Touching core/web/assets/index.html
run: mkdir -p core/web/assets && touch core/web/assets/index.html

- name: Download Go vendor packages
run: go mod download

- name: Replace chainlink-evm deps
if: ${{ github.event_name == 'workflow_dispatch' && inputs.evm-ref != ''}}
env:
GH_INPUTS_EVM_REF: ${{ inputs.evm-ref }}
shell: bash
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@$GH_INPUTS_EVM_REF

- name: Build binary
run: go build -o chainlink.test .

- name: Setup DB
run: ./chainlink.test local db preparetest

- name: Load test outputs
uses: actions/download-artifact@v4.1.8
with:
name: go_core_tests_logs
path: ./artifacts

- name: Delete go_core_tests_logs/coverage.txt
shell: bash
run: |
# Need to delete coverage.txt so the disk doesn't fill up
rm -f ./artifacts/go_core_tests_logs/coverage.txt
- name: Build flakey test runner
run: go build ./tools/flakeytests/cmd/runner

- name: Re-run tests
env:
GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
./runner \
-grafana_auth=$GRAFANA_INTERNAL_BASIC_AUTH \
-grafana_host=$GRAFANA_INTERNAL_HOST \
-gh_sha=$GITHUB_SHA \
-gh_event_path=$GITHUB_EVENT_PATH \
-gh_event_name=$GITHUB_EVENT_NAME \
-gh_run_id=$GITHUB_RUN_ID \
-gh_repo=$GITHUB_REPO \
-command=./tools/bin/go_core_tests \
`ls -R ./artifacts/output.txt`
- name: Store logs artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4.4.3
with:
name: flakey_test_runner_logs
path: |
./output.txt
retention-days: 7

scan:
name: SonarQube Scan
needs: [golangci, core, core-scripts-tests]
Expand Down Expand Up @@ -556,61 +460,14 @@ jobs:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_SCANNER_OPTS: "-Xms6g -Xmx8g"

trigger-flaky-test-detection-for-root-project:
name: Flakeguard Root Project
uses: ./.github/workflows/flakeguard.yml
if: ${{ github.event_name == 'pull_request' }}
with:
repoUrl: 'https://github.com/smartcontractkit/chainlink'
projectPath: '.'
baseRef: ${{ github.base_ref }}
headRef: ${{ github.head_ref }}
maxPassRatio: '1.0'
findByTestFilesDiff: true
findByAffectedPackages: false
slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications
extraArgs: '{ "skipped_tests": "TestChainComponents", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "omit_test_outputs_on_success": "true" }'
secrets:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}
FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}

trigger-flaky-test-detection-for-deployment-project:
name: Flakeguard Deployment Project
uses: ./.github/workflows/flakeguard.yml
needs: [filter]
if: ${{ github.event_name == 'pull_request' && needs.filter.outputs.deployment-changes == 'true'}}
with:
repoUrl: 'https://github.com/smartcontractkit/chainlink'
projectPath: 'deployment'
baseRef: ${{ github.base_ref }}
headRef: ${{ github.head_ref }}
maxPassRatio: '1.0'
findByTestFilesDiff: true
findByAffectedPackages: false
slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications
extraArgs: '{ "skipped_tests": "TestAddLane", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "omit_test_outputs_on_success": "true" }'
secrets:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}
FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}


clean:
name: Clean Go Tidy & Generate
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') && github.actor != 'dependabot[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu22.04-8cores-32GB
defaults:
run:
shell: bash
steps:
- name: Check for Skip Tests Label
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests')
run: |
echo "## \`skip-smoke-tests\` label is active, skipping E2E smoke tests" >>$GITHUB_STEP_SUMMARY
exit 0
- uses: actions/checkout@v4.2.1
with:
persist-credentials: false
Expand Down
Loading

0 comments on commit ae3e43c

Please sign in to comment.