generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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 029b5eb
Showing
87 changed files
with
19,455 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,7 @@ | ||
CARGO_TERM_COLOR=always | ||
NODE_VERSION=16.x | ||
PROGRAMS=["mpl-project-name"] | ||
RUST_VERSION=1.70.0 | ||
SOLANA_VERSION=1.16.18 | ||
COMMIT_USER_NAME=github-actions | ||
COMMIT_USER_EMAIL=[email protected] |
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,50 @@ | ||
# This file is used by the dorny/paths-filter action to figure out if a program or | ||
# client has changed and thus if it should be built or tested. Any changes in the | ||
# files listed below will trigger the appropriate workflow for that program or client. | ||
|
||
# Programs. | ||
|
||
program_common: &program_common | ||
- ".github/workflows/build-programs.yml" | ||
- ".github/workflows/test-programs.yml" | ||
- ".github/workflows/main.yml" | ||
- ".github/file-filters.yml" | ||
- ".github/.env" | ||
|
||
mpl_project_name_program: &mpl_project_name_program | ||
- *program_common | ||
- "programs/mpl-project-name/**" | ||
|
||
programs: &programs | ||
- *mpl_project_name_program | ||
|
||
# Clients. | ||
|
||
client_common: &client_common | ||
- *programs | ||
- ".github/workflows/test-js.yml" | ||
- ".github/workflows/test-rust-client.yml" | ||
- ".github/workflows/build-rust-client.yml" | ||
- ".github/workflows/main.yml" | ||
- ".github/file-filters.yml" | ||
- ".github/.env" | ||
- "configs/shank.cjs" | ||
- "configs/kinobi.cjs" | ||
|
||
js_client: &js_client | ||
- *client_common | ||
- "clients/js/**" | ||
|
||
rust_client: &rust_client | ||
- *client_common | ||
- "clients/rust/**" | ||
|
||
clients: &clients | ||
- *js_client | ||
- *rust_client | ||
|
||
# Any. | ||
|
||
any: &any | ||
- *programs | ||
- *clients |
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,69 @@ | ||
name: Benchmark | ||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
# deployments permission to deploy GitHub pages website | ||
deployments: write | ||
# contents permission to update benchmark contents in gh-pages branch | ||
contents: write | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
benchmark: | ||
name: Performance regression check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Start validator | ||
uses: metaplex-foundation/actions/start-validator@v1 | ||
with: | ||
node: 18.x | ||
solana: ${{ env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Install dependencies | ||
uses: metaplex-foundation/actions/install-node-dependencies@v1 | ||
with: | ||
folder: ./clients/js | ||
cache: ${{ env.CACHE }} | ||
key: clients-js | ||
|
||
- name: Build | ||
working-directory: ./clients/js | ||
run: pnpm build | ||
|
||
- name: Test | ||
working-directory: ./clients/js | ||
run: pnpm bench | ||
|
||
# Download previous benchmark result from cache (if exists) | ||
- name: Download previous benchmark data | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmark | ||
|
||
# Run `github-action-benchmark` action | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
# What benchmark tool the output.json came from | ||
tool: "customSmallerIsBetter" | ||
# Where the output from the benchmark tool is stored | ||
output-file-path: ./clients/js/output.json | ||
# Where the previous data file is stored | ||
# external-data-json-path: ./cache/benchmark-data.json | ||
# Workflow will fail when an alert happens | ||
fail-on-alert: true | ||
# Access token to deploy GitHub Pages branch | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# Push and deploy GitHub pages branch automatically | ||
auto-push: true |
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,65 @@ | ||
name: Build Programs | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rust: | ||
type: string | ||
solana: | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
rust: | ||
description: Rust version | ||
default: 1.70.0 | ||
required: true | ||
type: string | ||
solana: | ||
description: Solana version | ||
default: 1.16.17 | ||
required: true | ||
type: string | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
build_programs: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Install Rust | ||
uses: metaplex-foundation/actions/install-rust@v1 | ||
with: | ||
toolchain: ${{ inputs.rust || env.RUST_VERSION }} | ||
|
||
- name: Install Solana | ||
uses: metaplex-foundation/actions/install-solana@v1 | ||
with: | ||
version: ${{ inputs.solana || env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Cache program dependencies | ||
if: env.CACHE == 'true' | ||
uses: metaplex-foundation/actions/cache-programs@v1 | ||
|
||
- name: Build programs | ||
shell: bash | ||
working-directory: configs/scripts/program | ||
run: ./build.sh | ||
env: | ||
PROGRAMS: ${{ env.PROGRAMS }} | ||
|
||
- name: Upload program builds | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: program-builds | ||
# First wildcard ensures exported paths are consistently under the programs folder. | ||
path: ./program*/.bin/*.so | ||
if-no-files-found: error |
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,71 @@ | ||
name: Build Rust Client | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rust: | ||
type: string | ||
solana: | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
rust: | ||
description: Rust version | ||
default: 1.70.0 | ||
required: true | ||
type: string | ||
solana: | ||
description: Solana version | ||
default: 1.16.17 | ||
required: true | ||
type: string | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
build_sdk: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Install Rust | ||
uses: metaplex-foundation/actions/install-rust@v1 | ||
with: | ||
toolchain: ${{ inputs.rust || env.RUST_VERSION }} | ||
|
||
- name: Install Solana | ||
uses: metaplex-foundation/actions/install-solana@v1 | ||
with: | ||
version: ${{ inputs.solana || env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Cache Rust client test dependencies | ||
uses: metaplex-foundation/actions/cache-crate@v1 | ||
with: | ||
folder: ./clients/rust | ||
key: rust-client-test | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --all-features --no-deps --manifest-path ./clients/rust/Cargo.toml | ||
|
||
- name: Build Rust client | ||
shell: bash | ||
working-directory: clients/rust | ||
run: cargo build --all-features --release | ||
|
||
- name: Upload Rust client builds | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rust-client-builds | ||
# First wildcard ensures exported paths are consistently under the clients folder. | ||
path: ./targe*/release/*mpl_project_name* | ||
if-no-files-found: error |
Oops, something went wrong.