Skip to content

Commit

Permalink
Base 0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raghu0891 committed Nov 21, 2024
0 parents commit 9b03560
Show file tree
Hide file tree
Showing 418 changed files with 53,253 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
51 changes: 51 additions & 0 deletions .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
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@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6
with:
repository: plugin-starknet-tests
tag: ${{ inputs.tag }}
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Build and Publish Test Runner
if: steps.check-image.outputs.exists == 'false'
uses: goplugin/plugin-github-actions/docker/build-push@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6
with:
tags: |
${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/plugin-starknet-tests:${{ inputs.tag }}
${{ inputs.other_tags }}
file: ./integration-tests/test.Dockerfile
build-args: |
SUITES="smoke soak"
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Print Image Built
env:
INPUTS_TAG: ${{ inputs.tag }}
shell: sh
run: |
echo "### plugin-starknet-tests image tag for this test run :ship:" >> $GITHUB_STEP_SUMMARY
echo "\`${INPUTS_TAG}\`" >> $GITHUB_STEP_SUMMARY
27 changes: 27 additions & 0 deletions .github/workflows/amarna.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Amarna Analysis
on:
push:
branches:
- develop
- main
pull_request:

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Run Amarna
uses: crytic/[email protected]
id: amarna
continue-on-error: true
with:
amarna-args: --disable-inline --exclude-rules=must-check-caller-address
sarif: results.sarif
target: 'contracts/src/plugin/cairo/'

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.amarna.outputs.sarif }}
checkout_path: '/github/workspace'
46 changes: 46 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Changesets

on:
push:
branches:
- main

jobs:
changesets:
name: Changesets
runs-on: ubuntu-latest
steps:
# Checkout this repository
- name: Checkout Repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# Install nix
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
# Install dependencies using yarn
- name: Install Dependencies
run: nix develop -c yarn install --frozen-lockfile
# Create PR that will update versions or trigger publish
- name: Create Release Pull Request
uses: changesets/action@2a025e8ab1cfa4312c2868cb6aa3cd3b473b84bf # v1.3.0
id: changesets
with:
publish: nix develop -c yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Dispatch Relayer release
- name: Release relayer
run: gh workflow run .github/workflows/release/starknet-relayer.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Dispatch Gauntlet CLI build & release
- name: Build and release Gauntlet CLI
run: gh workflow run .github/workflows/release/starknet-gauntlet-cli.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Contracts

on:
push:
branches:
- develop
- main
pull_request:

jobs:
contracts_run_tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Test
run: nix develop -c make test-ts-contracts
80 changes: 80 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: golangci_lint

on:
push:

jobs:
golangci-lint-version:
name: Get golangci-lint version to from nix
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Parse version
id: parse
run: |
long=$(nix develop -c golangci-lint version | grep "golangci-lint has version")
stringArray=($long)
version=$(echo "${stringArray[3]}")
echo "version found: ${version}"
echo "version=${version}" >>$GITHUB_OUTPUT
outputs:
version: ${{ steps.parse.outputs.version }}

golang_lint_relayer:
name: Golang Lint Relayer
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint relayer
run: nix develop -c make lint-go-relayer

golang_lint_ops:
name: Golang Lint Ops
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint ops
run: nix develop -c make lint-go-ops

golang_lint_integration_tests:
name: Golang Lint Integration Tests
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint integration-tests
run: nix develop -c make lint-go-test
# Note: I could not figure out why the golangci-lint-action would not work even though it is technically running the same as above, error message is this:
# Running [/home/runner/golangci-lint-1.50.1-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=integration-tests --exclude=dot-imports] in [/home/runner/work/plugin-starknet/plugin-starknet/integration-tests] ...
# level=warning msg="[runner] Can't run linter goanalysis_metalinter: inspect: failed to load package client: could not load export data: no export data for \"github.com/goplugin/plugin-testing-framework/client\""
# level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: inspect: failed to load package client: could not load export data: no export data for \"github.com/goplugin/plugin-testing-framework/client\"\n\n"
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# env:
# CGO_ENABLED: 1
# with:
# version: v${{ needs.golangci-lint-version.outputs.version }}
# working-directory: integration-tests
# args: --exclude=dot-imports
37 changes: 37 additions & 0 deletions .github/workflows/integration-tests-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Integration Tests Publish
# Publish the compiled integration tests

on:
push:
branches:
- develop

env:
ECR_TAG: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin-starknet-tests:develop

jobs:
publish-integration-test-image:
environment: integration
permissions:
id-token: write
contents: read
name: Publish Integration Test Image
runs-on: ubuntu-latest
steps:
- name: Collect Metrics
id: collect-gha-metrics
uses: goplugin/push-gha-metrics-action@v1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Publish Integration Test Image
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Build Image
uses: ./.github/actions/build-test-image
with:
other_tags: ${{ env.ECR_TAG }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
Loading

0 comments on commit 9b03560

Please sign in to comment.