Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nightly runs #565

Merged
merged 11 commits into from
Jan 5, 2024
Merged
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
64 changes: 64 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Setup Go
description: Setup Golang with efficient caching
inputs:
only-modules:
description: Set to 'true' to only cache modules
default: "false"
cache-version:
description: Set this to cache bust
default: "1"
go-version-file:
description: Set where the go version file is located at
default: "go.mod"
go-module-file:
description: Set where the go module file is located at
default: "go.sum"

runs:
using: composite
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: ${{ inputs.go-version-file }}
cache: false

- name: Get branch name
if: ${{ inputs.only-modules == 'false' }}
id: branch-name
uses: tj-actions/branch-names@2e5354c6733793113f416314375826df030ada23 #v6.5

- name: Set go cache keys
shell: bash
id: go-cache-dir
run: |
echo "gomodcache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
echo "gobuildcache=$(go env GOCACHE)" >> $GITHUB_OUTPUT

- name: Set go module path
id: go-module-path
shell: bash
run: echo "path=./${{ inputs.go-module-file }}" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Cache Go Modules
with:
path: |
${{ steps.go-cache-dir.outputs.gomodcache }}
# The lifetime of go modules is much higher than the build outputs, so we increase cache efficiency
# here by not having the primary key contain the branch name
key: ${{ runner.os }}-gomod-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}
restore-keys: |
${{ runner.os }}-gomod-${{ inputs.cache-version }}-

- uses: actions/cache@v3
if: ${{ inputs.only-modules == 'false' }}
name: Cache Go Build Outputs
with:
path: |
${{ steps.go-cache-dir.outputs.gobuildcache }}
# The lifetime of go build outputs is pretty short, so we make our primary cache key be the branch name
key: ${{ runner.os }}-gobuild-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}-${{ steps.branch-name.outputs.current_branch }}
restore-keys: |
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}-
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-
134 changes: 109 additions & 25 deletions .github/workflows/e2e_testnet_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ on:
- cron: '0 6 * * *'
env:
CL_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ github.sha }}
CONTRACT_ARTIFACTS_PATH: contracts/target/deploy

# Only run 1 of this workflow at a time per PR
Expand All @@ -34,20 +33,82 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
environment: integration
name: Check Paths That Require Tests To Run
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
src:
- '**/*.go'
- '**/*go.sum'
- '**/*go.mod'
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/config/**/*.toml'
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Check Paths That Require Tests To Run
continue-on-error: true
outputs:
src: ${{ steps.changes.outputs.src }}
get_solana_sha:
name: Get Solana Sha From Go Mod
environment: Integration
runs-on: ubuntu-latest
outputs:
sha: ${{ github.sha }}
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Setup Go
uses: ./.github/actions/setup-go
with:
only-modules: "true"
- name: Get the sha from go mod
smickovskid marked this conversation as resolved.
Show resolved Hide resolved
id: getshortsha
run: |
short_sha=$(git rev-parse --short HEAD)
echo "short sha is: ${short_sha}"
echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT"
- name: Checkout solana
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this checkout used for and required?

uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: smartcontractkit/chainlink-solana
ref: develop
fetch-depth: 0
path: solanapath

get_projectserum_version:
name: Get ProjectSerum Version
environment: integration
runs-on: ubuntu-latest
needs: [ get_solana_sha ]
outputs:
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }}
steps:
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Checkout the solana repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: smartcontractkit/chainlink-solana
ref: ${{ needs.get_solana_sha.outputs.sha }}
- name: Get ProjectSerum Version
id: psversion
uses: ./.github/actions/projectserum_version
uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022

test-image-exists:
solana-test-image-exists:
environment: integration
permissions:
checks: write
Expand All @@ -56,37 +117,56 @@ jobs:
contents: read
name: Check If Solana Test Image Exists
runs-on: ubuntu-latest
needs: [ get_solana_sha ]
outputs:
exists: ${{ steps.check-image.outputs.exists }}
steps:
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.1
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@e865e376b8c2d594028c8d645dd6c47169b72974 # v2.2.16
with:
repository: chainlink-solana-tests
smickovskid marked this conversation as resolved.
Show resolved Hide resolved
tag: ${{ github.sha }}
tag: ${{ needs.get_solana_sha.outputs.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}

e2e_custom_build_artifacts:
name: E2E Custom Build Artifacts
environment: integration
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
needs: [get_projectserum_version, test-image-exists]
name: Solana Build Artifacts
runs-on: ubuntu20.04-16cores-64GB
needs:
[
changes,
get_projectserum_version,
solana-test-image-exists,
get_solana_sha,
]
container:
image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }}
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
steps:
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Collect Metrics
if: needs.changes.outputs.src == 'true'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Solana Build Artifacts
continue-on-error: true
- name: Checkout the solana repo
# Use v3.6.0 because the custom runner (container configured above)
# doesn't have node20 installed which is required for versions >=4
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
repository: smartcontractkit/chainlink-solana
ref: ${{ needs.get_solana_sha.outputs.sha }}
- name: Build contracts
if: needs.test-image-exists.outputs.exists == 'false'
uses: ./.github/actions/build_contract_artifacts
if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@21675b3a7dcdff8e790391708d4763020cace21e # stable action on December 18 2023
with:
ref: ${{ needs.get_solana_sha.outputs.sha }}

e2e_custom_build_custom_chainlink_image:
name: E2E Custom Build Custom CL Image
Expand Down Expand Up @@ -122,7 +202,7 @@ jobs:
contents: read
name: Build Test Image
runs-on: ubuntu-latest
needs: [e2e_custom_build_artifacts]
needs: [e2e_custom_build_artifacts, changes, solana-test-image-exists, get_solana_sha]
steps:
- name: Collect Metrics
id: collect-gha-metrics
Expand All @@ -133,16 +213,20 @@ jobs:
this-job-name: Build Test Image
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build Image
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Build Test Image
if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
uses: ./.github/actions/build-test-image
with:
tag: ${{ needs.get_solana_sha.outputs.sha }}
artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
- run: echo "this exists so we don't have to run anything else if the build is skipped"
if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true'

e2e_custom_run_daily_testnet_smoke_tests:
name: E2E Run Daily Smoke Tests
Expand All @@ -167,8 +251,8 @@ jobs:
PROGRAM_ID_OCR2: cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ
PROGRAM_ID_ACCESS_CONTROLLER: 9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW
PROGRAM_ID_STORE: HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny
LINK_TOKEN: 8Mib3j75H4V1C2UxRfgHNcgrMvyqKWQ5DZNk52vXdicH
VAULT_ADDRESS: Fhi9erqg4rDMJ1BusRxqay6iVAepyvESLCqMkQxgLPE
LINK_TOKEN: 7CF1GrsZsny5j9JESPj98MdYVZK38RE8ZpmTEMwECK4c
VAULT_ADDRESS: FdM4dnhVpFQfjPqNG6LEfzArhuGhUjtidYu89qtGwJCS
PRIVATE_KEY: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.PRIVATE_KEY || secrets.PRIVATE_KEY }}
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
steps:
Expand All @@ -182,7 +266,7 @@ jobs:
this-job-name: E2E Run Daily Smoke Tests
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.1
with:
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/soak/ocr2_soak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestSolanaOCRV2SoakTest(t *testing.T) {
state, err := common.NewOCRv2State(t, 5, "soak", "localnet", true)
state, err := common.NewOCRv2State(t, 5, "soak", "devnet", true)
require.NoError(t, err, "Could not setup the ocrv2 state")
if state.Common.Env.WillUseRemoteRunner() {
// run the remote runner and exit
Expand Down
Loading