Skip to content

CI Core

CI Core #129796

Workflow file for this run

name: CI Core
run-name: CI Core
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
# Run on key branches to make sure integration is good, otherwise run on all PR's
on:
push:
branches:
- develop
- "release/*"
merge_group:
pull_request:
schedule:
- cron: "0 0,1,2,3,4,5,6,20,21,22,23 * * *" # Run regularly at night to get better flaky test data
workflow_dispatch:
jobs:
filter:
name: Detect Changes
permissions:
pull-requests: read
outputs:
affected-modules: ${{ steps.changed-modules.outputs.modules-json }}
# Runs on workflow changes, and any (non-ignored) core changes
should-run-core-tests: >-
${{
steps.match-some.outputs.workflow == 'true' ||
steps.match-every.outputs.core-non-ignored == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v6
with:
persist-credentials: false
repository: smartcontractkit/chainlink
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: match-some
with:
# "if any changed file matches one or more of the conditions" (https://github.com/dorny/paths-filter/issues/225)
predicate-quantifier: some
# workflow - any changes that could affect this workflow definition
# - Assume any repository action changes affect this workflow
filters: |
workflow:
- '.github/workflows/ci-core.yml'
- '.github/actions/**'
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: match-every
with:
# "if any changed file match all of the conditions" (https://github.com/dorny/paths-filter/issues/225)
# - Enables listing of files matching each filter.
# - Paths to files will be available in `${FILTER_NAME}_files` output variable.
# - Paths will be formatted as JSON array
predicate-quantifier: every
# core-non-ignored - all changes except for paths which do not affect core module
# - This is opt-in on purpose. To be safe, new files are assumed to have an affect on core unless listed here specifically.
# - For example: core module does not depend on deployment or integration-tests module.
# all - changes in any directory
# - This is used resolve all affected modules based on changed files
list-files: json
filters: |
core-non-ignored:
- '**'
- '!deployment/**'
- '!integration-tests/**'
- '!tools/secrets/**'
- '!tools/docker/**'
- '!tools/benchmark/**'
- '!**/README.md'
- '!**/CHANGELOG.md'
- '!*.nix'
- '!sonar-project.properties'
- '!nix.conf'
- '!nix-darwin-shell-hook.sh'
- '!LICENSE'
- '!.github/**'
- '!core/scripts/cre/environment/examples/workflows/**'
all:
- '**'
- name: Decide which tests to run (rollout-only)
# To validate that this properly tests, we will run this beside the dorny/paths-filter actions
# before using its output to actually gate any jobs.
id: triggers
uses: smartcontractkit/.github/actions/advanced-triggers@advanced-triggers/v1
continue-on-error: true
with:
file-sets: |
go-files:
- "**/*.go"
- "**/go.mod"
- "**/go.sum"
core-files:
- "core/**"
all-test-files:
- "**/testdata/**"
- "**/*_test.go"
core-test-files:
- "testdata/**"
- "core/**/testdata/**"
- "core/**/*_test.go"
e2e-tests-files:
- "system-tests/**"
- "integration-tests/**"
workflow-files:
- ".github/workflows/ci-core.yml"
- ".github/actions/**"
deployment-files:
- "deployment/**"
ignored-files:
- "core/scripts/cre/environment/examples/workflows/**"
# Note:
# - for pull_request, merge_group, and push events, a trigger will resolve to true if any changed files match the path/glob patterns
# - exclusion-sets/negations are applied first, and therefore filter all changed files before inclusion sets are applied
# - by default these will resolve to true for schedule, and workflow_dispatch events
triggers: |
core-tests:
exclusion-sets: [ e2e-tests-files, deployment-files, ignored-files ]
inclusion-sets: [ go-files, core-files, all-test-files, workflow-files ]
paths:
- "tools/bin/go_core_tests"
core-fuzz-tests:
exclusion-sets: [ e2e-tests-files, deployment-files, ignored-files ]
inclusion-sets: [ go-files, core-files, all-test-files, workflow-files ]
paths:
- "!**/testdata/**"
- "**/fuzz/**"
- "tools/bin/go_core_fuzz"
core-race-tests:
exclusion-sets: [ e2e-tests-files, deployment-files, ignored-files ]
inclusion-sets: [ go-files, core-files, all-test-files, workflow-files ]
paths:
- "tools/bin/go_core_race_tests"
core-integration-tests:
exclusion-sets: [ e2e-tests-files, deployment-files, ignored-files ]
inclusion-sets: [ go-files, core-files, all-test-files, workflow-files ]
paths:
- "tools/bin/go_core_tests_integration"
- name: Changed modules
id: changed-modules
uses: smartcontractkit/.github/actions/changed-modules-go@changed-modules-go/v1
with:
# when scheduled/workflow_dispatch, run against all modules
no-change-behaviour: all
file-patterns: |
**/*.go
**/go.mod
**/go.sum
**/.golangci.yml
module-patterns: |
**
!core/scripts/cre/environment/examples/workflows/**
golangci:
name: GolangCI Lint
needs: [filter, run-frequency]
# We don't directly merge dependabot PRs to not waste the resources.
if:
${{ needs.filter.outputs.affected-modules != '[]' && github.event_name !=
'merge_group' && github.actor != 'dependabot[bot]' }}
permissions:
# To annotate code in the PR.
checks: write
contents: read
# For golangci-lint-action's `only-new-issues` option.
pull-requests: read
runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index
}}/cpu=16/ram=32/family=c6gd/spot=false/image=ubuntu24-full-arm64/extras=s3-cache
strategy:
fail-fast: false
matrix:
modules: ${{ fromJson(needs.filter.outputs.affected-modules) }}
steps:
- name: Enable S3 Cache for Self-Hosted Runners
uses: runs-on/action@d141ef83eb66d096ce8afc767e09115a65c63b60 # v2.1.2
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Golang Lint (${{ matrix.modules }})
id: golang-lint
uses: ./.github/actions/golangci-lint
timeout-minutes: 20
with:
go-directory: ${{ matrix.modules }}
- name: Notify Slack
# Skip for now as it's always failing on scheduled runs
if: ${{ failure() && needs.run-frequency.outputs.one-per-day-frequency == 'true' && 'false' == 'true' }}
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
method: chat.postMessage
token: ${{ secrets.QA_SLACK_API_KEY }}
payload: |
channel: ${{ secrets.SLACK_TEAM_CORE_CHANNEL_ID}}
text: "golangci-lint failed (${{ matrix.modules }}): <${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}|Run> - <${{ steps.golang-lint.outputs.golang-report-artifact-url }}|Report>"
# Fails if any golangci-lint matrix jobs fails and silently succeeds otherwise
# Consolidates golangci-lint matrix job results under one required `lint` check
# Inclusive check: all (new) modules are analyzed, but no need to enable "required" checks for each one
golangci-matrix-results-validation:
name: lint
if: ${{ always() }}
needs: [filter, golangci]
runs-on: ubuntu-latest
steps:
- name: Check Golangci-lint Matrix Results
env:
GOLANGCI_RESULT: ${{ needs.golangci.result }}
ALLOW_FAILURE:
${{ contains(join(github.event.pull_request.labels.*.name, ' '),
'allow-lint-issues') }}
SKIPPED: ${{ needs.filter.outputs.affected-modules == '[]' }}
run: |
if [[ "${GOLANGCI_RESULT}" == "success" ]]; then
echo "All 'GolangCI Lint' matrix jobs succeeded."
exit 0
fi
if [[ "${GOLANGCI_RESULT}" == "skipped" || "${SKIPPED}" == "true" ]]; then
echo "'GolangCI Lint' jobs were skipped."
exit 0
fi
if [[ "${ALLOW_FAILURE}" == "true" ]]; then
echo "Some 'GolangCI Lint' matrix jobs failed, but failures are allowed due to 'allow-lint-issues' label."
exit 0
fi
if [[ "${GOLANGCI_RESULT}" == "cancelled" ]]; then
echo "'GolangCI Lint' jobs were cancelled."
exit 1
fi
if [[ "${GOLANGCI_RESULT}" == "failure" ]]; then
echo "'GolangCI Lint' matrix jobs had failures."
exit 1
fi
core:
env:
# We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests
# when they should not be using it, while still allowing us to DRY up the setup
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
strategy:
fail-fast: false
matrix:
type:
- cmd: go_core_tests
os: runs-on=${{ github.run_id
}}-unit/cpu=48/ram=96/family=c6id+c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"
go-mod-directory: ""
setup-solana: "false"
setup-aptos: "false"
setup-sui: "false"
install-loopps: "false"
- cmd: go_core_tests_integration
os: runs-on=${{ github.run_id
}}-integ/cpu=48/ram=96/family=c6i/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"
setup-solana: "true"
install-loopps: "true"
go-mod-directory: ""
setup-aptos: "false"
setup-sui: "false"
- cmd: go_core_fuzz
os: runs-on=${{
github.run_id}}-fuzz/cpu=8/ram=32/family=m6id+m6idn/spot=false/image=ubuntu24-full-x64/extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "false"
go-mod-directory: ""
setup-solana: "false"
setup-aptos: "false"
setup-sui: "false"
install-loopps: "false"
- cmd: go_core_race_tests
os: runs-on=${{
github.run_id}}-race/cpu=64/ram=128/family=c7i/volume=80gb/spot=false/image=ubuntu24-full-x64/extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "false"
go-mod-directory: ""
setup-solana: "false"
setup-aptos: "false"
setup-sui: "false"
install-loopps: "false"
name: Core Tests (${{ matrix.type.cmd }}) # Be careful modifying the job name, as it is used to fetch the job URL
# We don't directly merge dependabot PRs, so let's not waste the resources
if: ${{ github.actor != 'dependabot[bot]' }}
needs: [filter, run-frequency]
timeout-minutes: 60
# Use ubuntu-latest for jobs that will be skipped
runs-on: ${{ matrix.type.should-run == 'true' && matrix.type.os ||
'ubuntu-latest' }}
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Enable S3 Cache for Self-Hosted Runners
uses: runs-on/action@d141ef83eb66d096ce8afc767e09115a65c63b60 # v2.1.2
- name: Checkout the repo
if: ${{ matrix.type.should-run == 'true' }}
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Go
if: ${{ matrix.type.should-run == 'true' }}
uses: ./.github/actions/setup-go
with:
# race/fuzz tests don't benefit repeated caching, so restore from develop's build cache
restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_fuzz' ||
matrix.type.cmd == 'go_core_race_tests' }}
build-cache-version: ${{ matrix.type.cmd }}
go-version-file: ${{ matrix.type.go-mod-directory }}go.mod
go-module-file: ${{ matrix.type.go-mod-directory }}go.sum
- name: Cache WASM test binaries
if: ${{ matrix.type.should-run == 'true' }}
uses: actions/cache@v6
with:
path: .wasm-cache/
# Best-effort warming key. Correctness is guaranteed by the in-code content
# fingerprint (filename), so a coarse/stale key here only risks a rebuild.
# restore-keys still restores the latest cache so only changed pkgs rebuild.
key: ${{ runner.os }}-wasmcache-${{ hashFiles('go.mod', 'go.sum', 'core/internal/testutils/wasmtest/**', 'core/capabilities/compute/**', 'core/services/workflows/**') }}
restore-keys: |
${{ runner.os }}-wasmcache-
- name: Setup Solana
if:
${{ matrix.type.should-run == 'true' && matrix.type.setup-solana == 'true'
}}
uses: ./.github/actions/setup-solana
- name: Setup Aptos
if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }}
uses: aptos-labs/actions/install-aptos-cli@fdd3a3a628c840d5c35086a87e9cc3141b635505 # 2026-05-20
with:
CLI_VERSION: 8.1.0
- name: Setup Sui CLI v1.72.2
if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }}
uses: ./.github/actions/setup-sui
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: mainnet-v1.72.2
- name: Setup Postgres
if: ${{ matrix.type.should-run == 'true' }}
uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1
with:
tmpfs: "true"
image-tag: "16-alpine"
postgres-options: "-c max_connections=1000 -c shared_buffers=2GB -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c client_min_messages=warning" # Turn off some prod-protections to make postgres go brrr. https://github.com/peterldowns/pgtestdb#how-do-i-make-it-go-faster
- name: Touching core/web/assets/index.html
if: ${{ matrix.type.should-run == 'true' }}
run: mkdir -p core/web/assets && touch core/web/assets/index.html
- name: Download Go vendor packages
if: ${{ matrix.type.should-run == 'true' }}
run: go mod download
- name: Setup DB
if: ${{ matrix.type.should-run == 'true' }}
run: go run ./core/store/cmd/preparetest
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
- name: Install LOOP Plugins
if:
${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true'
}}
run: make install-plugins
- name: Increase Timeouts for Fuzz/Race
# Increase timeouts for scheduled runs only
if: ${{ github.event.schedule != '' && matrix.type.should-run == 'true' }}
run: |
echo "TIMEOUT=10m" >> "$GITHUB_ENV"
echo "COUNT=50" >> "$GITHUB_ENV"
echo "FUZZ_TIMEOUT_MINUTES=10" >> "$GITHUB_ENV"
- name: Run tests
if: ${{ matrix.type.should-run == 'true' }}
timeout-minutes: 50
continue-on-error: ${{ matrix.type.trunk-auto-quarantine == 'true' }}
id: run-tests
shell: bash
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
OUTPUT_FILE: ./output.txt
PRODUCE_JUNIT_XML: ${{ matrix.type.trunk-auto-quarantine }}
TRUNK_AUTO_QUARANTINE: ${{ matrix.type.trunk-auto-quarantine }}
RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI
JUNIT_FILE: ${{ github.workspace }}/junit.xml
run: |
GODEBUG=goindex=0 ./tools/bin/${{ matrix.type.cmd }} ./...
# See: https://github.com/golang/go/issues/69179
- name: Analyze and upload test results
if:
${{ matrix.type.should-run == 'true' && matrix.type.trunk-auto-quarantine ==
'true' && !cancelled() }}
uses: smartcontractkit/.github/actions/branch-out-upload@branch-out-upload/v1
with:
junit-file-path: "./junit.xml"
trunk-org-slug: chainlink
trunk-token: ${{ secrets.TRUNK_API_KEY }}
trunk-previous-step-outcome: ${{ steps.run-tests.outcome }}
# when auto-quarantine is enabled, allow this to determine test failures
trunk-upload-only: ${{ matrix.type.trunk-auto-quarantine != 'true' }}
# unique name per matrix job to avoid 409 conflict when multiple jobs upload in the same workflow run
artifact-name: ${{ matrix.type.cmd }}_test_logs
- name: Print Races
id: print-races
if: ${{ failure() && matrix.type.cmd == 'go_core_race_tests' &&
matrix.type.should-run == 'true' }}
env:
GH_REPO: ${{ github.repository }}
GH_RUN_ID: ${{ github.run_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
find . -name 'race.*' -type f -exec cat {} + >> races.txt
if [[ -s races.txt ]]; then
cat races.txt
echo "post_to_slack=true" | tee -a "$GITHUB_OUTPUT"
else
echo "post_to_slack=false" | tee -a "$GITHUB_OUTPUT"
fi
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref: ${{ github.ref }}"
- name: Print postgres logs
if: ${{ always() && matrix.type.should-run == 'true' }}
uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1
with:
print-logs: "true"
- name: Store logs artifacts
if: ${{ always() && matrix.type.should-run == 'true' }}
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.type.cmd }}_logs
path: |
./output.txt
./output-short.txt
./race.*
./coverage.txt
./postgres_logs.txt
./junit.xml
retention-days: 7
- name: Notify Slack on Race Test Failure
if: |
failure() &&
matrix.type.cmd == 'go_core_race_tests' &&
steps.print-races.outputs.post_to_slack == 'true' &&
(github.event_name == 'merge_group' || github.ref == 'refs/heads/develop') &&
matrix.type.should-run == 'true'
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
method: chat.postMessage
token: ${{ secrets.QA_SLACK_API_KEY }}
payload: |
channel: ${{ secrets.SLACK_TOPIC_DATA_RACES_CHANNEL_ID}}
text: "Race Tests Failed: <${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}', github.repository, github.run_id, job.check_run_id) }}|Run>"
core-scripts-tests:
name: test-scripts
needs: [filter]
runs-on: ubuntu-latest
if: ${{ needs.filter.outputs.should-run-core-tests == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version-file: core/scripts/go.mod
go-module-file: core/scripts/go.sum
- name: Run Tests
env:
OUTPUT_FILE: ./output.txt
run: ./tools/bin/go_core_scripts_tests ./...
- name: Store test report artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: go_core_scripts_tests_logs
path: |
./output.txt
./coverage.txt
retention-days: 7
scan:
name: SonarQube Scan
needs: [golangci, core, core-scripts-tests]
# If core is cancelled, skip this to not delay the cancellation of the workflow.
if: ${{ always() && !cancelled() && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports
- name: Download all workflow artifacts
uses: actions/download-artifact@v8
- name: Check and Set SonarQube Report Paths
shell: bash
run: |
# Check and assign paths for coverage/test reports in go_core_tests_logs
core_artifact="go_core_tests_logs"
if [ -d "$core_artifact" ]; then
echo "Found $core_artifact"
sonarqube_coverage_report_paths=$(find "./${core_artifact}" -name coverage.txt | paste -sd "," -)
sonarqube_tests_report_paths=$(find "./${core_artifact}" -name output.txt | paste -sd "," -)
echo "Coverage report paths: $sonarqube_coverage_report_paths"
echo "Tests report paths: $sonarqube_tests_report_paths"
else
echo "Did not find $core_artifact"
sonarqube_coverage_report_paths=""
sonarqube_tests_report_paths=""
fi
# Check and assign paths for coverage/test reports in go_core_tests_integration_logs
integration_tests_artifact="go_core_tests_integration_logs"
if [ -d "$integration_tests_artifact" ]; then
echo "Found $integration_tests_artifact"
integration_coverage_paths=$(find "./${integration_tests_artifact}" -name coverage.txt | paste -sd "," -)
integration_tests_paths=$(find "./${integration_tests_artifact}" -name output.txt | paste -sd "," -)
# Append to existing paths if they are set, otherwise assign directly
sonarqube_coverage_report_paths="${sonarqube_coverage_report_paths:+$sonarqube_coverage_report_paths,}$integration_coverage_paths"
sonarqube_tests_report_paths="${sonarqube_tests_report_paths:+$sonarqube_tests_report_paths,}$integration_tests_paths"
fi
# Check and assign paths for coverage/test reports in go_core_scripts_tests_logs
scripts_tests_artifact="go_core_scripts_tests_logs"
if [ -d "$scripts_tests_artifact" ]; then
echo "Found $scripts_tests_artifact"
scripts_coverage_paths=$(find "./${scripts_tests_artifact}" -name coverage.txt | paste -sd "," -)
scripts_tests_paths=$(find "./${scripts_tests_artifact}" -name output.txt | paste -sd "," -)
# Append to existing paths if they are set, otherwise assign directly
sonarqube_coverage_report_paths="${sonarqube_coverage_report_paths:+$sonarqube_coverage_report_paths,}$scripts_coverage_paths"
sonarqube_tests_report_paths="${sonarqube_tests_report_paths:+$sonarqube_tests_report_paths,}$scripts_tests_paths"
fi
# Check and assign paths for lint reports
# To find reports in the folders named differently (because of the matrix strategy),
# We need to loop through the artifacts. It allows usage of RegExp folders (skipped if not found).
sonarqube_lint_report_paths=""
shopt -s nullglob
for golang_lint_artifact in golangci-lint-report*
do
[[ -d "$golang_lint_artifact" ]] || continue
echo "Found golangci-lint-report artifact: $golang_lint_artifact"
part=$(find "$golang_lint_artifact" -type f -name 'golangci-lint-report.xml' -printf '%p,')
sonarqube_lint_report_paths+="$part"
done
shopt -u nullglob
echo "Lint report paths: $sonarqube_lint_report_paths"
ARGS=""
if [[ -z "$sonarqube_tests_report_paths" ]]; then
echo "::warning::No test report paths found, will not pass to sonarqube"
else
echo "Found test report paths: $sonarqube_tests_report_paths"
ARGS="$ARGS -Dsonar.go.tests.reportPaths=$sonarqube_tests_report_paths"
fi
if [[ -z "$sonarqube_coverage_report_paths" ]]; then
echo "::warning::No coverage report paths found, will not pass to sonarqube"
else
echo "Found coverage report paths: $sonarqube_coverage_report_paths"
ARGS="$ARGS -Dsonar.go.coverage.reportPaths=$sonarqube_coverage_report_paths"
fi
if [[ -z "$sonarqube_lint_report_paths" ]]; then
echo "::warning::No lint report paths found, will not pass to sonarqube"
else
echo "Found lint report paths: $sonarqube_lint_report_paths"
ARGS="$ARGS -Dsonar.go.golangci-lint.reportPaths=$sonarqube_lint_report_paths"
fi
echo "Final SONARQUBE_ARGS: $ARGS"
echo "SONARQUBE_ARGS=$ARGS" >> "$GITHUB_ENV"
- name: SonarQube Scan
if: ${{ env.SONARQUBE_ARGS != '' }}
uses: sonarsource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0
with:
args: ${{ env.SONARQUBE_ARGS }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_SCANNER_OPTS: "-Xms6g -Xmx8g"
clean:
name: Clean Go Tidy & Generate
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu22.04-8cores-32GB
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Go
uses: ./.github/actions/setup-go
with:
only-modules: "true"
- name: Install protoc-gen-go-wsrpc
run: curl
https://github.com/smartcontractkit/wsrpc/raw/main/cmd/protoc-gen-go-wsrpc/protoc-gen-go-wsrpc
--output "$HOME/go/bin/protoc-gen-go-wsrpc" && chmod +x
"$HOME/go/bin/protoc-gen-go-wsrpc"
- name: make generate
run: |
make rm-mocked
make generate
- name: Ensure clean after generate
run: |
git add --all
if ! git diff --cached --quiet; then
echo "::error::Tree is dirty after 'make generate'. Full diff below:"
git diff --cached
exit 1
fi
- run: make gomodtidy
- name: Ensure clean after tidy
run: |
git add --all
if ! git diff --cached --quiet; then
echo "::error::Tree is dirty after 'make gomodtidy'. Full diff below:"
git diff --cached
exit 1
fi
run-frequency:
name: Run frequency
outputs:
one-per-day-frequency: ${{ steps.check-time.outputs.one-per-day-frequency || 'false' }}
runs-on: ubuntu-latest
steps:
- name: Check time and set frequencies
id: check-time
shell: bash
run: |
if [ "$GITHUB_EVENT_NAME" != "schedule" ]; then
# Not a scheduled event - no frequencies to set. They default to false.
exit 0
fi
# Scheduled event, check current time for frequencies
current_hour=$(date +"%H")
# Check if the current hour is 00 (one per day)
if [ "$current_hour" -eq "00" ]; then
echo "one-per-day-frequency=true" | tee -a "$GITHUB_OUTPUT"
fi
misc:
# Catchall job for miscellaneous steps.
name: Misc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup go
uses: ./.github/actions/setup-go
##
# Plugins (LOOPPs) are defined in ./plugins/plugins.*.yaml files.
# Some plugins such as chainlink-data-streams, chainlink-feeds,
# and chainlink-solana are also dependencies in the go.mod file.
# This job is to ensure that the versions defined in the go.mod file are
# in sync with the gitRef field in the plugins YAML files.
#
# If you update the version of a module in the go.mod file, you must
# update the gitRef for the corresponding module in the plugins YAML file
# to match.
##
- name: Plugins Sync Check (Plugout)
run: |
echo "Check for out of sync plugins"
go run ./tools/plugout/ \
--go-mod ./go.mod \
--plugin-file ./plugins/plugins.public.yaml