Skip to content

Commit

Permalink
Merge pull request #10622 from smartcontractkit/release/2.5.0
Browse files Browse the repository at this point in the history
release/2.5.0 -> master
  • Loading branch information
chainchad authored Sep 13, 2023
2 parents c6c6273 + acbb562 commit 4fb58aa
Show file tree
Hide file tree
Showing 1,033 changed files with 89,659 additions and 38,328 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-sign-publish-chainlink/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ runs:
- if: inputs.publish == 'true'
# Log in to AWS for publish to ECR
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
with:
role-to-assume: ${{ inputs.aws-role-to-assume }}
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
aws-region: ${{ inputs.aws-region }}

- if: inputs.publish == 'true'
name: Login to ECR
uses: docker/login-action@42d299face0c5c43a0487c477f595ac9cf22f1a7 # v1.12.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ${{ inputs.ecr-hostname }}

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ runs:
steps:
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
repository: ${{ inputs.repository }}
tag: ${{ inputs.tag }}
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Build and Publish Test Runner
if: steps.check-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5
uses: smartcontractkit/chainlink-github-actions/docker/build-push@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
tags: |
${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/${{ inputs.repository }}:${{ inputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/goreleaser-build-sign-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
with:
role-to-assume: ${{ secrets.aws-role-arn }}
role-duration-seconds: ${{ secrets.aws-role-dur-sec }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/goreleaser-build-sign-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ runs:
cosign-release: ${{ inputs.cosign-version }}
- name: Login to docker registry
if: inputs.enable-docker-publish == 'true'
uses: docker/login-action@42d299face0c5c43a0487c477f595ac9cf22f1a7 # v1.12.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ${{ inputs.docker-registry }}
- name: Goreleaser release
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/setup-wasmd/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup Cosmos wasmd
description: Setup Cosmos wasmd, used for integration tests
runs:
using: composite
steps:
- uses: actions/cache@v3
id: cache
name: Cache wasmd-build
with:
path: ~/wasmd-build
# this caching works without cloning the repo because the install_wasmd contains
# the commit hash.
key: ${{ runner.os }}-wasmd-cli-${{ hashFiles('./tools/ci/install_wasmd') }}

- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install wasmd
shell: bash
run: ./tools/ci/install_wasmd

- name: Export wasmd path to env
shell: bash
run: echo "PATH=$HOME/wasmd-build/bin:$PATH" >> $GITHUB_ENV
51 changes: 51 additions & 0 deletions .github/actions/split-tests/src/handlers/golang.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { execSync } from "child_process";
import {
GolangConfig,
GoSplits,
GoPackageData,
TestsBySplit,
} from "../types.mjs";
import { simpleSplit } from "../splitter.mjs";

export interface GetGoPackagesReturn {
packages: string[];
testsBySplit: TestsBySplit;
splits: GoSplits;
serializedSplits: string
}

export function getPackageList(
config: GolangConfig,
): GetGoPackagesReturn {
const { numOfSplits } = config;
const rawPackages = execSync(
"go list -json ./... | jq -s '[.[] | {ImportPath, TestGoFiles, XTestGoFiles}]'",
{ encoding: "utf8" }
);
const packages: GoPackageData[] = JSON.parse(rawPackages.trimEnd());
const filteredData = packages.filter(
(item) => (item.TestGoFiles && item.TestGoFiles.length > 0) || (item.XTestGoFiles && item.XTestGoFiles.length > 0)
);
const packagePaths = filteredData.map((item) => item.ImportPath);
return handleSplit(packagePaths, numOfSplits);
}

function handleSplit(
packages: string[],
numOfSplits: number
): GetGoPackagesReturn {
console.log(`${packages.length} packages to split...`);
const packagesBySplit = simpleSplit(packages, [], numOfSplits);
const splits: GoSplits = packagesBySplit.map((pkgs, i) => ({
idx: `${i + 1}`,
id: `${i + 1}/${numOfSplits}`,
pkgs: pkgs.join(" "),
}));
const o: GetGoPackagesReturn = {
packages,
testsBySplit: packagesBySplit,
splits,
serializedSplits: JSON.stringify(splits),
};
return o;
}
17 changes: 4 additions & 13 deletions .github/actions/split-tests/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "./types.mjs";
import {sieveSlowTests} from "./sieve.mjs";
import {simpleSplit} from "./splitter.mjs";
import { getPackageList, GetGoPackagesReturn } from "../src/handlers/golang.mjs";

/**
* Get a JSON formatted config file
Expand Down Expand Up @@ -47,19 +48,9 @@ async function main() {
main();

async function handleGolang(config: GolangConfig) {
const {numOfSplits} = config;
const rawPackages = await $`go list ./...`;
const packages = rawPackages.stdout.trimEnd().split("\n");
console.log(`${packages.length} packages to split...`);
const packagesBySplit = simpleSplit(packages, [], numOfSplits);
const splits: GoSplits = packagesBySplit.map((pkgs, i) => ({
idx: `${i + 1}`,
id: `${i + 1}/${numOfSplits}`,
pkgs: pkgs.join(" "),
}));
const serializedSplits = JSON.stringify(splits);
setOutput("splits", serializedSplits);
createSummary(packages, packagesBySplit, splits);
const p: GetGoPackagesReturn = getPackageList(config)
setOutput("splits", p.serializedSplits);
createSummary(p.packages, p.testsBySplit, p.splits);
}

async function handleSolidity(config: SolidityConfig) {
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/split-tests/src/types.mts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,20 @@ export interface SolidityConfig {
slowTests?: string[];
}[];
}

export interface GoPackageData {
/**
* The package path
*/
ImportPath: string;
/**
* The list of go files asociated with the package
*/
TestGoFiles: string[] | undefined;
/**
* The list of go files not associated with a specific package
* Things like integration tests
*/
XTestGoFiles: string[] | undefined;
// there are many other variables in the data but they are not needed yet
}
4 changes: 2 additions & 2 deletions .github/workflows/automation-benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.1
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
env:
DETACH_RUNNER: true
TEST_SUITE: benchmark
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/automation-ondemand-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Collect Metrics
if: inputs.chainlinkImage == ''
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@8163dcea2f01a0a8fec84b284406ff7af1d2e1c0
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand All @@ -49,15 +49,15 @@ jobs:
- name: Check if image exists
if: inputs.chainlinkImage == ''
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 #v2.2.1
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
repository: chainlink
tag: ${{ github.sha }}${{ matrix.image.tag-suffix }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false' && inputs.chainlinkImage == ''
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.1
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.sha }}
Expand All @@ -81,7 +81,7 @@ jobs:
steps:
- name: Collect Metrics
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@8163dcea2f01a0a8fec84b284406ff7af1d2e1c0
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
echo "version=develop" >>$GITHUB_OUTPUT
fi
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 #v2.2.1
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
env:
PYROSCOPE_SERVER: ${{ matrix.tests.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
PYROSCOPE_ENVIRONMENT: ${{ matrix.tests.pyroscope_env }}
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@8163dcea2f01a0a8fec84b284406ff7af1d2e1c0
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
Expand Down
Loading

0 comments on commit 4fb58aa

Please sign in to comment.