Skip to content

Commit

Permalink
Merge pull request #276 from smartcontractkit/develop
Browse files Browse the repository at this point in the history
Release v1.0.0 (contracts version)
  • Loading branch information
krebernisak committed Mar 30, 2022
2 parents 73c628e + 4b5832f commit d001951
Show file tree
Hide file tree
Showing 393 changed files with 21,692 additions and 22,160 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/chaos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: e2e_chaos_tests
on:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
inputs:
cl_branch_ref:
description: Chainlink repo branch to integrate with
required: true
default: develop
type: string

jobs:
chaos_testing_build_contracts:
name: Chaos Testing Build Contracts
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.22.1
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v2
- run: echo $HOME
- run: echo $PATH
- run: yarn install --frozen-lockfile
- name: Generate program_ids
run: ./scripts/programs-keys-gen.sh
- name: Build Contracts
run: anchor build
working-directory: contracts
- name: Upload Artifacts
uses: actions/upload-artifact@master
with:
name: target
path: contracts/target/deploy
chaos_testing_build_custom_chainlink_image:
name: Chaos Testing Build Custom Chainlink Image
# target branch can't be set as var, it's from where we getting pipeline code
uses: smartcontractkit/chainlink/.github/workflows/build-custom.yml@develop
with:
cl_repo: smartcontractkit/chainlink
# by default we are integrating with develop
cl_ref: ${{ github.event.inputs.cl_branch_ref }}
# commit of the caller branch
dep_solana_sha: ${{ github.sha }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.QA_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.QA_AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
chaos_testing_run_test:
name: Chaos Testing Run Test
runs-on: ubuntu-latest
needs: [chaos_testing_build_contracts, chaos_testing_build_custom_chainlink_image]
env:
CGO_ENABLED: 1
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: .tool-versions to .env
run: ./scripts/tool-versions-to-env.sh
- name: dotenv
uses: falti/dotenv-action@v0.2.7
id: dotenv
- name: Setup go ${{ steps.dotenv.outputs.golang_version }}
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.golang_version }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.QA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.QA_AWS_SECRET_KEY }}
aws-region: ${{ secrets.QA_AWS_REGION }}
role-to-assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.QA_KUBECONFIG }}
- name: Cache Vendor Packages
uses: actions/cache@v2
id: cache-packages
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Vendor Packages
if: steps.cache-packages.outputs.cache-hit != 'true'
run: go mod download
- name: Install Ginkgo CLI
run: |
go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.1.2
go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.1.2
go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.1.2
go install github.com/onsi/ginkgo/v2/ginkgo
- name: Download Artifacts
uses: actions/download-artifact@master
with:
name: target
path: contracts/target/deploy
- name: Run Tests
env:
SELECTED_NETWORKS: solana
NETWORK_SETTINGS: /home/runner/work/chainlink-solana/chainlink-solana/tests/e2e/networks.yaml
CHAINLINK_IMAGE: 795953128386.dkr.ecr.us-west-2.amazonaws.com/chainlink
CHAINLINK_VERSION: custom.${{ github.sha }}
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ginkgo tests/e2e/chaos
- name: Publish Test Results
uses: mikepenz/action-junit-report@v2
if: always()
with:
report_paths: "./tests-chaos-report.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Chaos Test Results
- name: Publish Artifacts
if: failure()
uses: actions/upload-artifact@v2.2.4
with:
name: test-logs
path: ./tests/e2e/chaos/logs
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [develop]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]
schedule:
- cron: "28 23 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["go", "javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@546b30f35ae5a3db0e0be1843008c2224f71c3b0
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@546b30f35ae5a3db0e0be1843008c2224f71c3b0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@546b30f35ae5a3db0e0be1843008c2224f71c3b0
9 changes: 6 additions & 3 deletions .github/workflows/contract-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Artifacts
name: release_artifacts
on:
push:
tags:
Expand All @@ -10,9 +10,10 @@ defaults:
working-directory: ./contracts
jobs:
release-artifacts:
name: Release Artifacts
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.2
image: projectserum/build:v0.22.1
env:
RUSTUP_HOME: "/root/.rustup"
steps:
Expand All @@ -25,4 +26,6 @@ jobs:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: contracts/artifacts.tar.gz
files: |
contracts/artifacts.tar.gz
contracts/target/deploy/*.so
104 changes: 75 additions & 29 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,79 @@
name: e2e_tests
on: [push]
name: e2e_smoke_tests
on:
workflow_call:
inputs:
repo_name:
required: true
default: ${{ github.repository }}
type: string
ref:
required: true
default: ${{ github.sha }}
type: string
cl_repo:
required: true
default: public.ecr.aws/z0b1w9r9/chainlink
type: string
cl_image:
required: true
default: develop
type: string
secrets:
QA_AWS_ACCESS_KEY_ID:
required: true
QA_AWS_SECRET_KEY:
required: true
QA_AWS_REGION:
required: true
QA_AWS_ROLE_TO_ASSUME:
required: true
QA_KUBECONFIG:
required: true

jobs:
build:
e2e_build_contracts:
name: E2E Build Contracts
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.0
image: projectserum/build:v0.22.1
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.repo_name }}
- run: echo $HOME
- run: echo $PATH
- run: |
npm config set -- '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
NPM_TOKEN=${NPM_TOKEN} yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile
- name: Generate program_ids
run: ./scripts/programs-keys-gen.sh
- run: anchor build
working-directory: contracts
- uses: actions/upload-artifact@master
- name: Upload Artifacts
uses: actions/upload-artifact@master
with:
name: target
path: contracts/target/deploy
smoke:
e2e_run_smoke_tests:
name: E2E Run Smoke Tests
runs-on: ubuntu-latest
needs: build
env:
CGO_ENABLED: 1
needs: e2e_build_contracts
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: 1.17
repository: ${{ inputs.repo_name }}
ref: ${{ inputs.ref }}
- name: .tool-versions to .env
run: ./scripts/tool-versions-to-env.sh
- name: dotenv
uses: falti/dotenv-action@v0.2.7
id: dotenv
- name: Setup go ${{ steps.dotenv.outputs.golang_version }}
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.golang_version }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -55,31 +94,38 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
~/go/bin
key: ${{ runner.os }}-go2-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go2-
- name: Download Go Vendor Packages
if: steps.cache-packages.outputs.cache-hit != 'true'
run: go mod download
run: make download
- name: Install Ginkgo CLI
if: steps.cache-packages.outputs.cache-hit != 'true'
run: |
make install
- name: Check for ginkgo ls
run: |
go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.0.0-rc2
go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.0.0-rc2
go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.0.0-rc2
go install github.com/onsi/ginkgo/v2/ginkgo
- uses: actions/download-artifact@master
ls ~/go/bin/
- name: Download Artifacts
uses: actions/download-artifact@master
with:
name: target
path: contracts/target/deploy
- name: cp static deploy keys
run: ./scripts/programs-keys-cp.sh
- name: Echo inputs
run: echo ${{ inputs.cl_repo }} ${{ inputs.cl_image }}
- name: Env vars
run: env
- name: Run Tests
env:
SELECTED_NETWORKS: solana
NETWORK_SETTINGS: /home/runner/work/chainlink-solana/chainlink-solana/tests/e2e/networks.yaml
CHAINLINK_IMAGE: ${{ inputs.cl_repo }}
CHAINLINK_VERSION: ${{ inputs.cl_image }}
CGO_ENABLED: 1
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ginkgo tests/e2e/smoke
make test_smoke
- name: Publish Test Results
uses: mikepenz/action-junit-report@v2
if: always()
Expand All @@ -92,4 +138,4 @@ jobs:
uses: actions/upload-artifact@v2.2.4
with:
name: test-logs
path: ./logs
path: ./tests/e2e/smoke/logs

0 comments on commit d001951

Please sign in to comment.