Skip to content

Commit

Permalink
Merge pull request #49 from smartcontractkit/ci
Browse files Browse the repository at this point in the history
add CI & isolate gethwrappers as module
  • Loading branch information
jmank88 authored May 23, 2024
2 parents 3390c48 + e59774c commit 41e7f9b
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 0 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: pull-request-master

on:
merge_group:
pull_request:
branches:
- master
# Only run 1 of this workflow at a time per PR
concurrency:
group: chainlink-vrf-${{ github.ref }}
cancel-in-progress: true

env:
PACKAGES: "./.."

jobs:
init:
runs-on: ubuntu-latest
outputs:
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set matrix packages
id: set-matrix-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: |
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
- name: Set lint args packages
id: set-lint-args-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
# Convert "producer,reports_consumer" to "./producer/... ./reports_consumer/..."
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"

ci-lint:
runs-on: ubuntu-latest
needs: [init]
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-lint
uses: smartcontractkit/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: true
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
golangci-lint-version: "v1.55.2"
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml

ci-lint-misc:
runs-on: ubuntu-latest
steps:
- name: ci-lint-misc
uses: smartcontractkit/.github/actions/ci-lint-misc@6b08487b176ef7cad086526d0b54ddff6691c044 # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint-misc
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}

ci-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-test
uses: smartcontractkit/.github/actions/ci-test-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-test
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# docker inputs
use-docker-compose: "true"
docker-compose-workdir: ./tools/docker/setup-postgres
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: "true"
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
go-test-cmd: make test-ci
85 changes: 85 additions & 0 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: push-master

on:
push:
branches:
- master

env:
PACKAGES: "./..."

jobs:
init:
runs-on: ubuntu-latest
outputs:
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set matrix packages
id: set-matrix-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: |
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
- name: Set lint args packages
id: set-lint-args-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"

ci-lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-lint
uses: smartcontractkit/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: true
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
golangci-lint-version: "v1.55.2"
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml

ci-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-test
uses: smartcontractkit/.github/actions/ci-test-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-test
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# docker inputs
use-docker-compose: "true"
docker-compose-workdir: ./tools/docker/setup-postgres
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: "true"
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
go-test-cmd: make test-ci
42 changes: 42 additions & 0 deletions gethwrappers/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module github.com/smartcontractkit/vrf/gethwrappers

go 1.22.3

require (
github.com/ethereum/go-ethereum v1.13.8
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240229152020-3390c480411a
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/tools v0.20.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

// replicating the replace directive on cosmos SDK
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Loading

0 comments on commit 41e7f9b

Please sign in to comment.