Skip to content

Commit d001951

Browse files
authored
Merge pull request #276 from smartcontractkit/develop
Release v1.0.0 (contracts version)
2 parents 73c628e + 4b5832f commit d001951

File tree

393 files changed

+21692
-22160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+21692
-22160
lines changed

.github/workflows/chaos.yml

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: e2e_chaos_tests
2+
on:
3+
schedule:
4+
- cron: '0 */3 * * *'
5+
workflow_dispatch:
6+
inputs:
7+
cl_branch_ref:
8+
description: Chainlink repo branch to integrate with
9+
required: true
10+
default: develop
11+
type: string
12+
13+
jobs:
14+
chaos_testing_build_contracts:
15+
name: Chaos Testing Build Contracts
16+
runs-on: ubuntu-latest
17+
container:
18+
image: projectserum/build:v0.22.1
19+
env:
20+
RUSTUP_HOME: "/root/.rustup"
21+
FORCE_COLOR: 1
22+
steps:
23+
- uses: actions/checkout@v2
24+
- run: echo $HOME
25+
- run: echo $PATH
26+
- run: yarn install --frozen-lockfile
27+
- name: Generate program_ids
28+
run: ./scripts/programs-keys-gen.sh
29+
- name: Build Contracts
30+
run: anchor build
31+
working-directory: contracts
32+
- name: Upload Artifacts
33+
uses: actions/upload-artifact@master
34+
with:
35+
name: target
36+
path: contracts/target/deploy
37+
chaos_testing_build_custom_chainlink_image:
38+
name: Chaos Testing Build Custom Chainlink Image
39+
# target branch can't be set as var, it's from where we getting pipeline code
40+
uses: smartcontractkit/chainlink/.github/workflows/build-custom.yml@develop
41+
with:
42+
cl_repo: smartcontractkit/chainlink
43+
# by default we are integrating with develop
44+
cl_ref: ${{ github.event.inputs.cl_branch_ref }}
45+
# commit of the caller branch
46+
dep_solana_sha: ${{ github.sha }}
47+
secrets:
48+
AWS_ACCESS_KEY_ID: ${{ secrets.QA_AWS_ACCESS_KEY_ID }}
49+
AWS_SECRET_ACCESS_KEY: ${{ secrets.QA_AWS_SECRET_KEY }}
50+
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
51+
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
52+
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
53+
chaos_testing_run_test:
54+
name: Chaos Testing Run Test
55+
runs-on: ubuntu-latest
56+
needs: [chaos_testing_build_contracts, chaos_testing_build_custom_chainlink_image]
57+
env:
58+
CGO_ENABLED: 1
59+
steps:
60+
- name: Checkout the repo
61+
uses: actions/checkout@v2
62+
- name: .tool-versions to .env
63+
run: ./scripts/tool-versions-to-env.sh
64+
- name: dotenv
65+
uses: falti/[email protected]
66+
id: dotenv
67+
- name: Setup go ${{ steps.dotenv.outputs.golang_version }}
68+
uses: actions/setup-go@v2
69+
with:
70+
go-version: ${{ steps.dotenv.outputs.golang_version }}
71+
- name: Configure AWS Credentials
72+
uses: aws-actions/configure-aws-credentials@v1
73+
with:
74+
aws-access-key-id: ${{ secrets.QA_AWS_ACCESS_KEY_ID }}
75+
aws-secret-access-key: ${{ secrets.QA_AWS_SECRET_KEY }}
76+
aws-region: ${{ secrets.QA_AWS_REGION }}
77+
role-to-assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
78+
role-duration-seconds: 3600
79+
- name: Set Kubernetes Context
80+
uses: azure/k8s-set-context@v1
81+
with:
82+
method: kubeconfig
83+
kubeconfig: ${{ secrets.QA_KUBECONFIG }}
84+
- name: Cache Vendor Packages
85+
uses: actions/cache@v2
86+
id: cache-packages
87+
with:
88+
path: |
89+
~/.cache/go-build
90+
~/go/pkg/mod
91+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
92+
restore-keys: |
93+
${{ runner.os }}-go-
94+
- name: Download Go Vendor Packages
95+
if: steps.cache-packages.outputs.cache-hit != 'true'
96+
run: go mod download
97+
- name: Install Ginkgo CLI
98+
run: |
99+
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
100+
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
101+
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
102+
go install github.com/onsi/ginkgo/v2/ginkgo
103+
- name: Download Artifacts
104+
uses: actions/download-artifact@master
105+
with:
106+
name: target
107+
path: contracts/target/deploy
108+
- name: Run Tests
109+
env:
110+
SELECTED_NETWORKS: solana
111+
NETWORK_SETTINGS: /home/runner/work/chainlink-solana/chainlink-solana/tests/e2e/networks.yaml
112+
CHAINLINK_IMAGE: 795953128386.dkr.ecr.us-west-2.amazonaws.com/chainlink
113+
CHAINLINK_VERSION: custom.${{ github.sha }}
114+
run: |
115+
export PATH=$PATH:$(go env GOPATH)/bin
116+
ginkgo tests/e2e/chaos
117+
- name: Publish Test Results
118+
uses: mikepenz/action-junit-report@v2
119+
if: always()
120+
with:
121+
report_paths: "./tests-chaos-report.xml"
122+
github_token: ${{ secrets.GITHUB_TOKEN }}
123+
check_name: Chaos Test Results
124+
- name: Publish Artifacts
125+
if: failure()
126+
uses: actions/[email protected]
127+
with:
128+
name: test-logs
129+
path: ./tests/e2e/chaos/logs

.github/workflows/codeql-analysis.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [develop]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [develop]
20+
schedule:
21+
- cron: "28 23 * * 0"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["go", "javascript"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
42+
43+
- name: Set up Go
44+
uses: actions/setup-go@v2
45+
with:
46+
go-version: ^1.17
47+
48+
# Initializes the CodeQL tools for scanning.
49+
- name: Initialize CodeQL
50+
uses: github/codeql-action/init@546b30f35ae5a3db0e0be1843008c2224f71c3b0
51+
with:
52+
languages: ${{ matrix.language }}
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@546b30f35ae5a3db0e0be1843008c2224f71c3b0
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@546b30f35ae5a3db0e0be1843008c2224f71c3b0

.github/workflows/contract-release.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Artifacts
1+
name: release_artifacts
22
on:
33
push:
44
tags:
@@ -10,9 +10,10 @@ defaults:
1010
working-directory: ./contracts
1111
jobs:
1212
release-artifacts:
13+
name: Release Artifacts
1314
runs-on: ubuntu-latest
1415
container:
15-
image: projectserum/build:v0.18.2
16+
image: projectserum/build:v0.22.1
1617
env:
1718
RUSTUP_HOME: "/root/.rustup"
1819
steps:
@@ -25,4 +26,6 @@ jobs:
2526
- name: Create Release
2627
uses: softprops/action-gh-release@v1
2728
with:
28-
files: contracts/artifacts.tar.gz
29+
files: |
30+
contracts/artifacts.tar.gz
31+
contracts/target/deploy/*.so

.github/workflows/e2e.yml

+75-29
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,79 @@
1-
name: e2e_tests
2-
on: [push]
1+
name: e2e_smoke_tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
repo_name:
6+
required: true
7+
default: ${{ github.repository }}
8+
type: string
9+
ref:
10+
required: true
11+
default: ${{ github.sha }}
12+
type: string
13+
cl_repo:
14+
required: true
15+
default: public.ecr.aws/z0b1w9r9/chainlink
16+
type: string
17+
cl_image:
18+
required: true
19+
default: develop
20+
type: string
21+
secrets:
22+
QA_AWS_ACCESS_KEY_ID:
23+
required: true
24+
QA_AWS_SECRET_KEY:
25+
required: true
26+
QA_AWS_REGION:
27+
required: true
28+
QA_AWS_ROLE_TO_ASSUME:
29+
required: true
30+
QA_KUBECONFIG:
31+
required: true
332

433
jobs:
5-
build:
34+
e2e_build_contracts:
35+
name: E2E Build Contracts
636
runs-on: ubuntu-latest
737
container:
8-
image: projectserum/build:v0.18.0
38+
image: projectserum/build:v0.22.1
939
env:
1040
RUSTUP_HOME: "/root/.rustup"
1141
FORCE_COLOR: 1
12-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1342
steps:
1443
- uses: actions/checkout@v2
44+
with:
45+
repository: ${{ inputs.repo_name }}
1546
- run: echo $HOME
1647
- run: echo $PATH
17-
- run: |
18-
npm config set -- '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
19-
NPM_TOKEN=${NPM_TOKEN} yarn install --frozen-lockfile
48+
- run: yarn install --frozen-lockfile
49+
- name: Generate program_ids
50+
run: ./scripts/programs-keys-gen.sh
2051
- run: anchor build
2152
working-directory: contracts
22-
- uses: actions/upload-artifact@master
53+
- name: Upload Artifacts
54+
uses: actions/upload-artifact@master
2355
with:
2456
name: target
2557
path: contracts/target/deploy
26-
smoke:
58+
e2e_run_smoke_tests:
59+
name: E2E Run Smoke Tests
2760
runs-on: ubuntu-latest
28-
needs: build
29-
env:
30-
CGO_ENABLED: 1
61+
needs: e2e_build_contracts
3162
steps:
3263
- name: Checkout the repo
3364
uses: actions/checkout@v2
34-
- name: Setup go
35-
uses: actions/setup-go@v1
3665
with:
37-
go-version: 1.17
66+
repository: ${{ inputs.repo_name }}
67+
ref: ${{ inputs.ref }}
68+
- name: .tool-versions to .env
69+
run: ./scripts/tool-versions-to-env.sh
70+
- name: dotenv
71+
uses: falti/[email protected]
72+
id: dotenv
73+
- name: Setup go ${{ steps.dotenv.outputs.golang_version }}
74+
uses: actions/setup-go@v2
75+
with:
76+
go-version: ${{ steps.dotenv.outputs.golang_version }}
3877
- name: Configure AWS Credentials
3978
uses: aws-actions/configure-aws-credentials@v1
4079
with:
@@ -55,31 +94,38 @@ jobs:
5594
path: |
5695
~/.cache/go-build
5796
~/go/pkg/mod
58-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
97+
~/go/bin
98+
key: ${{ runner.os }}-go2-${{ hashFiles('**/go.sum') }}
5999
restore-keys: |
60-
${{ runner.os }}-go-
100+
${{ runner.os }}-go2-
61101
- name: Download Go Vendor Packages
62102
if: steps.cache-packages.outputs.cache-hit != 'true'
63-
run: go mod download
103+
run: make download
64104
- name: Install Ginkgo CLI
105+
if: steps.cache-packages.outputs.cache-hit != 'true'
106+
run: |
107+
make install
108+
- name: Check for ginkgo ls
65109
run: |
66-
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
67-
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
68-
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
69-
go install github.com/onsi/ginkgo/v2/ginkgo
70-
- uses: actions/download-artifact@master
110+
ls ~/go/bin/
111+
- name: Download Artifacts
112+
uses: actions/download-artifact@master
71113
with:
72114
name: target
73115
path: contracts/target/deploy
74-
- name: cp static deploy keys
75-
run: ./scripts/programs-keys-cp.sh
116+
- name: Echo inputs
117+
run: echo ${{ inputs.cl_repo }} ${{ inputs.cl_image }}
118+
- name: Env vars
119+
run: env
76120
- name: Run Tests
77121
env:
78122
SELECTED_NETWORKS: solana
79-
NETWORK_SETTINGS: /home/runner/work/chainlink-solana/chainlink-solana/tests/e2e/networks.yaml
123+
CHAINLINK_IMAGE: ${{ inputs.cl_repo }}
124+
CHAINLINK_VERSION: ${{ inputs.cl_image }}
125+
CGO_ENABLED: 1
80126
run: |
81127
export PATH=$PATH:$(go env GOPATH)/bin
82-
ginkgo tests/e2e/smoke
128+
make test_smoke
83129
- name: Publish Test Results
84130
uses: mikepenz/action-junit-report@v2
85131
if: always()
@@ -92,4 +138,4 @@ jobs:
92138
uses: actions/[email protected]
93139
with:
94140
name: test-logs
95-
path: ./logs
141+
path: ./tests/e2e/smoke/logs

0 commit comments

Comments
 (0)