Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions .github/workflows/ci-core-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: CI Core Integration
run-name: CI Core Integration

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:


jobs:
list-all-tag-combinations:
name: List all tag combinations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1

- name: List all tags (./core/)
working-directory: ./core
run: |
find . -name '*.go' -print0 \
| xargs -0 grep -hE '^[[:space:]]*//(go:build|\+build)' 2>/dev/null \
| sed -E '
s|^[[:space:]]*//go:build[[:space:]]+||;
s|^[[:space:]]*//\+build[[:space:]]+||;
s/[[:space:]]+$//
' \
| sed -E '/^[[:space:]]*$/d' \
| sort -u

- name: List all tags (./deployment/)
working-directory: ./deployment
run: |
find . -name '*.go' -print0 \
| xargs -0 grep -hE '^[[:space:]]*//(go:build|\+build)' 2>/dev/null \
| sed -E '
s|^[[:space:]]*//go:build[[:space:]]+||;
s|^[[:space:]]*//\+build[[:space:]]+||;
s/[[:space:]]+$//
' \
| sed -E '/^[[:space:]]*$/d' \
| sort -u

tagged-tests:
Comment on lines +20 to +53

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 12 months ago

The best way to fix the problem is to explicitly set the permissions for the list-all-tag-combinations job. According to least privilege principles and since this job only checks out code and runs a few shell commands, it only requires read access to repository contents. Therefore, add a permissions block to the job with contents: read as the only permission.
To implement, insert the block under list-all-tag-combinations: (indented to match the other keys), before runs-on: .... No other code changes are needed.


Suggested changeset 1
.github/workflows/ci-core-integration.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci-core-integration.yml b/.github/workflows/ci-core-integration.yml
--- a/.github/workflows/ci-core-integration.yml
+++ b/.github/workflows/ci-core-integration.yml
@@ -18,6 +18,8 @@
 jobs:
   list-all-tag-combinations:
     name: List all tag combinations
+    permissions:
+      contents: read
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v5
EOF
@@ -18,6 +18,8 @@
jobs:
list-all-tag-combinations:
name: List all tag combinations
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Copilot is powered by AI and may make mistakes. Always verify output.
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:
- module: Deployment
cmd: go_core_ccip_deployment_tests
os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache
tags: "integration solana"
go-mod-directory: "deployment/"
setup-solana: "true"
setup-plugins: "true"

- module: Deployment
cmd: go_core_ccip_deployment_tests
os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache
tags: "integration aptos"
go-mod-directory: "deployment/"
aptos-cli-version: "7.10.0"
setup-plugins: "true"

- module: Deployment
cmd: go_core_ccip_deployment_tests
os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache
tags: "integration db"
go-mod-directory: "deployment/"
setup-plugins: "true"

name: "${{ matrix.type.module }} - Tagged Tests (${{matrix.type.tags}})"
timeout-minutes: 20
runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index }}/${{ matrix.type.os }}
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Enable S3 Cache for Self-Hosted Runners
# these env vars are set (and exposed) when it is a self-hosted runner with extras=s3-cache
if: ${{ env.RUNS_ON_INSTANCE_ID != '' && env.ACTIONS_CACHE_URL != '' }}
uses: runs-on/action@66d4449b717b5462159659523d1241051ff470b9 # v1

- name: Checkout the repo
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Go
uses: ./.github/actions/setup-go
with:
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: Setup Postgres
uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1
with:
tmpfs: "true"
image-tag: "16-alpine"

- name: Setup DB
run: go run ./core/store/cmd/preparetest
env:
CL_DATABASE_URL: ${{ env.DB_URL }}

- 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: Setup Solana
if: matrix.type.setup-solana == 'true'
uses: ./.github/actions/setup-solana

- name: Setup Aptos
if: ${{ matrix.type.aptos-cli-version != '' }}
uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025
with:
CLI_VERSION: ${{ matrix.type.aptos-cli-version }}

# - name: Setup Sui CLI v1.57.2
# uses: ./.github/actions/setup-sui
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# version: mainnet-1.57.2

- name: Setup wasmd
if: matrix.type.setup-plugins == 'true'
uses: ./.github/actions/setup-wasmd

- name: Install LOOP Plugins
if: matrix.type.setup-plugins == 'true'
run: make install-plugins

- name: Run tests
timeout-minutes: 22
id: run-tests
shell: bash
env:
GO_TEST_TAGS: ${{ matrix.type.tags }}
CL_DATABASE_URL: ${{ env.DB_URL }}
OUTPUT_FILE: ./output.txt
PRODUCE_JUNIT_XML: true
JUNIT_FILE: ${{ github.workspace }}/junit.xml
RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI
run: |
GODEBUG=goindex=0 ./tools/bin/${{ matrix.type.cmd }} ./...
# See: https://github.com/golang/go/issues/69179

- name: Artifact name
id: artifact-name
if: ${{ always() }}
env:
CMD: ${{ matrix.type.cmd }}
TAGS: ${{ matrix.type.tags }}
run: |
# replace spaces with underscores for artifact names
TAGS_UNDERSCORED=${TAGS// /_}
echo "artifact-name=${CMD}_${TAGS_UNDERSCORED}_logs" | tee -a "$GITHUB_OUTPUT"

- name: Store logs artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact-name.outputs.artifact-name }}
path: |
./output.txt
./output-short.txt
./race.*
./coverage.txt
./postgres_logs.txt
./junit.xml
./deployment/junit.xml
retention-days: 7
83 changes: 41 additions & 42 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ jobs:
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"

- cmd: go_core_tests_integration
os: ${{ needs.runner-config.outputs.core-tests-integration-runner }}
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"
setup-solana: "true"
install-loopps: "true"
# - cmd: go_core_tests_integration
# os: ${{ needs.runner-config.outputs.core-tests-integration-runner }}
# should-run: ${{ needs.filter.outputs.should-run-core-tests }}
# trunk-auto-quarantine: "true"
# setup-solana: "true"
# install-loopps: "true"

- cmd: go_core_fuzz
os: ${{ needs.runner-config.outputs.core-fuzz-tests-runner }}
Expand Down Expand Up @@ -255,33 +255,33 @@ jobs:
go-version-file: ${{ matrix.type.go-mod-directory }}go.mod
go-module-file: ${{ matrix.type.go-mod-directory }}go.sum

- 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@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025
with:
CLI_VERSION: 7.10.0

- name: Setup Sui CLI v1.57.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-1.57.2

- name: Setup wasmd
if: ${{ matrix.type.should-run == 'true' }}
uses: ./.github/actions/setup-wasmd

- 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"
# - 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@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025
# with:
# CLI_VERSION: 7.10.0

# - name: Setup Sui CLI v1.57.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-1.57.2

# - name: Setup wasmd
# if: ${{ matrix.type.should-run == 'true' }}
# uses: ./.github/actions/setup-wasmd

# - 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"

- name: Touching core/web/assets/index.html
if: ${{ matrix.type.should-run == 'true' }}
Expand All @@ -291,15 +291,15 @@ jobs:
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: 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: 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
Expand Down Expand Up @@ -334,7 +334,6 @@ jobs:
trunk-org-slug: chainlink
trunk-token: ${{ secrets.TRUNK_API_KEY }}
trunk-previous-step-outcome: ${{ steps.run-tests.outcome }}
trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }}
# when auto-quarantine is enabled, allow this to determine test failures
trunk-upload-only: ${{ matrix.type.trunk-auto-quarantine != 'true' }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ jobs:
id-token: write
contents: read
needs: changes
if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
if: false
# if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@9874c1f4ab4a4c70433df6d8f862044ca18456df # 2025-11-26
with:
workflow_name: Run CCIP Integration Tests For PR
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ jobs:

labels:
name: Get PR labels and set runner labels
if: github.actor != 'dependabot[bot]'
if: false
# if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -192,7 +193,8 @@ jobs:

build-chainlink:
name: Build Chainlink Image ${{ matrix.image.name }}
if: github.actor != 'dependabot[bot]'
if: false
# if: github.actor != 'dependabot[bot]'
environment: integration
runs-on: ${{ matrix.image.runner }}
needs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package config

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && aptos

package aptos_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && aptos

package aptos

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && aptos

package aptos_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && aptos

package aptos_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package ccip_attestation_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package ccip_attestation_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && solana

package crossfamily_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration && solana

package v1_6_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package changeset_test

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package changeset_test

import (
Expand Down
Loading
Loading