Skip to content

Commit

Permalink
Base 0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raghu0891 committed Dec 9, 2024
0 parents commit 16f98ff
Show file tree
Hide file tree
Showing 410 changed files with 181,795 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
watch_file shell.nix
use flake
8 changes: 8 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
self-hosted-runner:
# Labels of self-hosted or large runner labels in array of string
labels:
- ubuntu-latest-4cores-16GB
- ubuntu-latest-8cores-32GB
- ubuntu-latest-16cores-64GB
- ubuntu-latest-32cores-128GB
- ubuntu-latest-64cores-256GB
29 changes: 29 additions & 0 deletions .github/actions/build-gauntlet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Install gauntlet dependencies
description: A GitHub Action to get tool versions and build Gauntlet

runs:
using: 'composite'
steps:
- name: Checkout Repository
uses: actions/[email protected]

- name: Get Tool Versions
uses: goplugin/[email protected]
id: tool-versions

- name: Setup Node ${{ steps.tool-versions.outputs.nodejs_version }}
uses: actions/[email protected]
with:
node-version: ${{ steps.tool-versions.outputs.nodejs_version }}

- name: Install Dependencies
run: yarn --cwd ./gauntlet install --frozen-lockfile
shell: bash

- name: Build Gauntlet
run: yarn --cwd ./gauntlet build
shell: bash

- name: Run Gauntlet
run: yarn --cwd ./gauntlet gauntlet
shell: bash
71 changes: 71 additions & 0 deletions .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build Test Image
description: A composite action that allows building and publishing the test remote runner image

inputs:
tag:
description: The tag to use by default and to use for checking image existance
default: ${{ github.sha }}
required: false
other_tags:
description: Other tags to push if needed
required: false
artifacts_path:
description: The path for downloading the built artifacts
required: false
default: contracts/target/deploy
suites:
description: The test suites to build into the image
default: smoke soak
required: false
QA_AWS_ROLE_TO_ASSUME:
description: The AWS role to assume as the CD user, if any. Used in configuring the docker/login-action
required: true
QA_AWS_REGION:
description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action
required: true
QA_AWS_ACCOUNT_NUMBER:
description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action
required: true

runs:
using: composite
steps:
- name: Check if image exists
id: check-image
uses: goplugin/plugin-github-actions/docker/image-exists@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
repository: plugin-solana-tests
tag: ${{ inputs.tag }}
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: artifacts
path: ${{ inputs.artifacts_path }}
- name: Get CTF Version
id: version
uses: goplugin/plugin-github-actions/plugin-testing-framework/mod-version@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
go-project-path: ./integration-tests
module-name: github.com/goplugin/plugin-testing-framework/lib
enforce-semantic-tag: false
- name: Build and Publish Test Runner
if: steps.check-image.outputs.exists == 'false'
uses: goplugin/plugin-github-actions/docker/build-push@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
tags: |
${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/plugin-solana-tests:${{ inputs.tag }}
${{ inputs.other_tags }}
file: ./integration-tests/test.Dockerfile
build-args: |
BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image
IMAGE_VERSION=${{ steps.version.outputs.version }}
SUITES="${{ inputs.suites }}"
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Print Image Built
shell: sh
run: |
echo "### plugin-solana-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY
echo "\`${{ inputs.tag }}\`" >>$GITHUB_STEP_SUMMARY
54 changes: 54 additions & 0 deletions .github/actions/build_contract_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Contract Artifacts
description: Common builder for test contracts for automated tests
inputs:
ref:
required: false
description: The plugin-solana ref to use
image:
required: false
description: docker image to use to build
image-version:
required: false
description: docker image version/tag to use for build

runs:
using: composite
steps:
- name: Checkout solana
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
repository: goplugin/plugin-solana
ref: ${{ inputs.ref }}

# temporary docker run to build artifacts
- name: Docker Builder
if: ${{ inputs.image != '' && inputs.image-version != '' }}
env:
image: ${{ inputs.image }}
image_version: ${{ inputs.image-version }}
shell: bash
run: |
# start container
docker run -d -v $(pwd):/repo --name build-container "${image}":"${image_version}" tail -f /dev/null
# generate go bindings
docker exec build-container bash -c "/repo/scripts/build-contract-artifacts-action.sh"
# check go bindings
git diff --stat --exit-code
# build with keys
docker exec build-container bash -c "\
export RUSTUP_HOME=\"/root/.rustup\" &&\
cd /repo &&\
./scripts/programs-keys-gen.sh &&\
cd ./contracts &&\
anchor build &&\
chown -R $(id -u):$(id -g) /repo"
# clean up the container
docker stop build-container
docker rm build-container
#save the contracts artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: artifacts
path: contracts/target/deploy
16 changes: 16 additions & 0 deletions .github/actions/projectserum_version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Get ProjectSerum Image Version
description: Gets the projectserum version in the makefile
outputs:
projectserum_version:
description: The projectserum image version
value: ${{ steps.psversion.outputs.PSVERSION }}

runs:
using: composite
steps:
- name: Get the projectserum version
id: psversion
shell: bash
run: |
PSVERSION=$(make projectserum_version)
echo "PSVERSION=${PSVERSION}" >>$GITHUB_OUTPUT
64 changes: 64 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Setup Go
description: Setup Golang with efficient caching
inputs:
only-modules:
description: Set to 'true' to only cache modules
default: "false"
cache-version:
description: Set this to cache bust
default: "1"
go-version-file:
description: Set where the go version file is located at
default: "go.mod"
go-module-file:
description: Set where the go module file is located at
default: "go.sum"

runs:
using: composite
steps:
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: ${{ inputs.go-version-file }}
cache: false

- name: Get branch name
if: ${{ inputs.only-modules == 'false' }}
id: branch-name
uses: tj-actions/branch-names@6871f53176ad61624f978536bbf089c574dc19a2 # v8.0.1

- name: Set go cache keys
shell: bash
id: go-cache-dir
run: |
echo "gomodcache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
echo "gobuildcache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
- name: Set go module path
id: go-module-path
shell: bash
run: echo "path=./${{ inputs.go-module-file }}" >> $GITHUB_OUTPUT

- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
name: Cache Go Modules
with:
path: |
${{ steps.go-cache-dir.outputs.gomodcache }}
# The lifetime of go modules is much higher than the build outputs, so we increase cache efficiency
# here by not having the primary key contain the branch name
key: ${{ runner.os }}-gomod-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}
restore-keys: |
${{ runner.os }}-gomod-${{ inputs.cache-version }}-
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
if: ${{ inputs.only-modules == 'false' }}
name: Cache Go Build Outputs
with:
path: |
${{ steps.go-cache-dir.outputs.gobuildcache }}
# The lifetime of go build outputs is pretty short, so we make our primary cache key be the branch name
key: ${{ runner.os }}-gobuild-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}-${{ steps.branch-name.outputs.current_branch }}
restore-keys: |
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-${{ hashFiles(steps.go-module-path.output.path) }}-
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Description

<!---
Please include a brief description of changes if not obvious from the PR title
Does this work have a corresponding ticket?
Please link your Jira ticket by including it in one of the following reference:
- the PR title
- branch name
- commit message
- PR description
Example:
[PLI-777](https://smartcontract-it.atlassian.net/browse/PLI-777)
-->

### Requires Dependencies
<!---
Does this work depend on other open PRs?
Please list other PRs that are blocking this PR.
Example:
- https://github.com/goplugin/plugin-common/pull/7777777
-->

### Resolves Dependencies
<!---
Does this work support other open PRs?
Please list other PRs that are waiting for this PR to be merged.
Example:
- https://github.com/goplugin/ccip/pull/7777777
-->
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "go.mod"
check-latest: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
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@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3

# ℹ️ 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@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
Loading

0 comments on commit 16f98ff

Please sign in to comment.