-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4d89c14
Showing
959 changed files
with
175,563 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Run Benchmarks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Go Benchmark Action | ||
uses: patrickhuie19/benchmark-action@b46d0ce6c3b4bd423380f7d3c6abed389e38ea4a | ||
with: | ||
benchmarks-pr: 'BenchmarkKeystore_Sign' # Use benchmarks specified in PR, or default benchmarks | ||
benchmarks-merge: 'BenchmarkKeystore_Sign' # Default list of benchmarks to run on merges | ||
trigger-branches: 'main' # Comma-separated list of branches for merging | ||
use-gh-pages: 'true' # Enable or disable GitHub Pages | ||
github-token: ${{ secrets.GITHUB_TOKEN }} # Use the built-in GitHub token | ||
gh-pages-branch: 'gh-pages' # GitHub Pages branch (if use-gh-pages is true) | ||
alert-comment-cc-users: '@patrickhuie19' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
# Builds external repositories that use this so we can create tickets to update them before their ci pipelines break. | ||
# NOTE: This is not a required check to merge, merely a check so you know to create tickets to update the products that rely on this. | ||
name: Build External Repositories | ||
on: | ||
pull_request: | ||
|
||
# Only run 1 of this workflow at a time per PR | ||
concurrency: | ||
group: integration-build-check-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-plugin: | ||
environment: integration | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: Build Plugin Image | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Get core ref from PR body | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
comment=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body') | ||
core_ref=$(echo $comment | grep -oP 'core ref: \K\S+' || true) | ||
if [ ! -z "$core_ref" ]; then | ||
echo "CUSTOM_CORE_REF=${core_ref}" >> "${GITHUB_ENV}" | ||
else | ||
echo "CUSTOM_CORE_REF=develop" >> "${GITHUB_ENV}" | ||
fi | ||
- name: Collect Metrics | ||
id: collect-gha-metrics | ||
uses: goplugin/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 | ||
with: | ||
id: build-plugin | ||
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
this-job-name: Build Plugin Image | ||
continue-on-error: true | ||
- name: Checkout the repo | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Build the image | ||
uses: goplugin/plugin-github-actions/plugin-testing-framework/build-image@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16 | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
with: | ||
push_tag: "" | ||
cl_repo: goplugin/pluginv3.0 | ||
cl_ref: ${{ env.CUSTOM_CORE_REF }} | ||
dep_common_sha: ${{ github.event.pull_request.head.sha }} | ||
should_checkout: true | ||
QA_AWS_REGION: "" | ||
QA_AWS_ROLE_TO_ASSUME: "" | ||
solana-build-relay: | ||
environment: integration | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: Solana Build Relay | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get solana ref from PR body | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
comment=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body') | ||
solana_ref=$(echo $comment | grep -oP 'solana ref: \K\S+' || true) | ||
if [ ! -z "$solana_ref" ]; then | ||
echo "CUSTOM_SOLANA_REF=${solana_ref}" >> "${GITHUB_ENV}" | ||
else | ||
echo "CUSTOM_SOLANA_REF=develop" >> "${GITHUB_ENV}" | ||
fi | ||
- name: Collect Metrics | ||
id: collect-gha-metrics | ||
uses: goplugin/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 | ||
with: | ||
id: solana-build-relay | ||
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
this-job-name: Solana Build Relay | ||
continue-on-error: true | ||
- name: Checkout the solana repo | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
repository: goplugin/plugin-solana | ||
ref: ${{ env.CUSTOM_SOLANA_REF }} | ||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: Replace plugin-common deps | ||
run: | | ||
go get github.com/goplugin/plugin-common@${{ github.event.pull_request.head.sha }} | ||
go mod tidy | ||
- name: Install Solana CLI | ||
run: ./scripts/install-solana-ci.sh | ||
- name: Build & Test | ||
run: make test_relay_unit | ||
starknet-build-relay: | ||
environment: integration | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: Starknet Build Relay | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get starknet ref from PR body | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
comment=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body') | ||
starknet_ref=$(echo $comment | grep -oP 'starknet ref: \K\S+' || true) | ||
if [ ! -z "$starknet_ref" ]; then | ||
echo "CUSTOM_STARKNET_REF=${starknet_ref}" >> "${GITHUB_ENV}" | ||
else | ||
echo "CUSTOM_STARKNET_REF=develop" >> "${GITHUB_ENV}" | ||
fi | ||
- name: Collect Metrics | ||
id: collect-gha-metrics | ||
uses: goplugin/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 | ||
with: | ||
id: starknet-build-relay | ||
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
this-job-name: Starknet Build Relay | ||
continue-on-error: true | ||
- name: Checkout the starknet repo | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
repository: goplugin/plugin-starknet | ||
ref: ${{ env.CUSTOM_STARKNET_REF }} | ||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: ./relayer/go.mod | ||
- name: Replace plugin-common deps | ||
run: | | ||
cd relayer | ||
go get github.com/goplugin/plugin-common@${{ github.event.pull_request.head.sha }} | ||
go mod tidy | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- name: Build | ||
run: nix develop -c make build-go-relayer | ||
- name: Test | ||
run: nix develop -c make test-unit-go | ||
# terra-build-relay: | ||
# environment: integration | ||
# permissions: | ||
# id-token: write | ||
# contents: read | ||
# name: Terra Build Relay | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Collect Metrics | ||
# id: collect-gha-metrics | ||
# uses: goplugin/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 | ||
# with: | ||
# id: terra-build-relay | ||
# basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
# hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
# org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
# this-job-name: Terra Build Relay | ||
# continue-on-error: true | ||
# - name: Checkout the terra repo | ||
# uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
# with: | ||
# repository: goplugin/plugin-terra | ||
# - name: Setup Go | ||
# uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
# with: | ||
# go-version-file: "go.mod" | ||
# - name: Replace plugin-common deps | ||
# run: | | ||
# go get github.com/goplugin/plugin-common@${{ github.event.pull_request.head.sha }} | ||
# go mod tidy | ||
# - name: Install Nix | ||
# uses: cachix/install-nix-action@v14 | ||
# with: | ||
# install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install | ||
# install_options: "--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve" | ||
# extra_nix_config: | | ||
# experimental-features = nix-command flakes | ||
# access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
# - name: Compile relay | ||
# run: nix develop -c go build -v ./pkg/terra/... | ||
# - name: Run unit tests | ||
# run: nix develop -c go test -v ./pkg/terra/... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Golangci-lint | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | ||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: Build binary | ||
shell: bash | ||
run: go build ./... | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 | ||
with: | ||
version: v1.60.1 | ||
# only-new-issues is only applicable to PRs, otherwise it is always set to false | ||
only-new-issues: true | ||
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml | ||
- name: Print lint report artifact | ||
if: failure() | ||
shell: bash | ||
run: cat ./golangci-lint-report.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Observability Lib Checks | ||
|
||
on: | ||
push: | ||
paths: | ||
- "observability-lib/**" | ||
|
||
jobs: | ||
run-tests: | ||
defaults: | ||
run: | ||
working-directory: observability-lib | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Unit Tests | ||
run: go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: PKG Build and Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Unit Tests | ||
run: GORACE="log_path=$PWD/race" go test -race ./... -coverpkg=./... -coverprofile=pkg_coverage.out | ||
|
||
- name: Print Races | ||
if: failure() | ||
id: print-races | ||
run: | | ||
find race.* | xargs cat > race.txt | ||
if [[ -s race.txt ]]; then | ||
cat race.txt | ||
fi | ||
- name: Fuzz Tests | ||
# the amount of --seconds here is subject to change based on how long the CI job takes in the future | ||
# as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage. | ||
# We are timing out after ~10mins in case the tests hang. (Current CI duration is ~7m, modify if needed) | ||
# See https://github.com/golang/go/issues/52569 there's a bug that causes fuzz tests to fail if they run too long. | ||
# 12s was working for a long time in core, and always ran successfully for > 12 s for this repo before failing too. | ||
# Note: Users in a linked issue said that it took hours to fail on a mac, vs seconds or minutes on linux. | ||
run: cd fuzz && timeout 10m ./fuzz_all_native.py --ci --seconds 12 | ||
|
||
- name: Log Fuzz Tests Failing Inputs | ||
if: failure() | ||
run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done | ||
|
||
- name: Upload Fuzz Tests Failing Inputs | ||
if: failure() | ||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | ||
with: | ||
name: failing-fuzz-inputs | ||
path: "**/testdata/fuzz/**" | ||
|
||
- name: Upload Go test results | ||
if: always() | ||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | ||
with: | ||
name: go-test-results | ||
path: | | ||
./pkg_coverage.out | ||
./race.* | ||
check-tidy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: Ensure "make gomodtidy" has been run | ||
run: | | ||
make gomodtidy | ||
git diff --minimal --exit-code | ||
- name: Ensure "make generate" has been run | ||
run: | | ||
make rm-mocked | ||
make rm-builders | ||
make generate | ||
git diff --stat --exit-code |
Oops, something went wrong.