Skip to content

Commit

Permalink
misc update
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Jun 23, 2024
1 parent 67d4ef4 commit 3f72439
Show file tree
Hide file tree
Showing 18 changed files with 339 additions and 555 deletions.
31 changes: 31 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Setup environment

inputs:
cache:
description: Enable caching
default: "true"
node:
description: The Node.js version to install
required: true
solana:
description: The Solana version to install

runs:
using: "composite"
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- name: Install Solana
if: ${{ inputs.solana != '' }}
uses: metaplex-foundation/actions/install-solana@v1
with:
version: ${{ inputs.solana }}
cache: ${{ inputs.cache }}
196 changes: 196 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: Main

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
NODE_VERSION: 20
SOLANA_VERSION: 1.18.15
CARGO_CACHE: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
jobs:
build_programs:
name: Build programs
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup
with:
node: ${{ env.NODE_VERSION }}
solana: ${{ env.SOLANA_VERSION }}
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: ${{ env.CARGO_CACHE }}
key: ${{ runner.os }}-cargo-programs-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-programs
- name: Build programs
run: pnpm programs:build
- name: Upload program builds
uses: actions/upload-artifact@v4
with:
name: program-builds
path: ./target/deploy/*.so
if-no-files-found: error
- name: Save all builds for clients
uses: actions/cache/save@v4
with:
path: ./**/*.so
key: ${{ runner.os }}-builds-${{ github.sha }}

test_programs:
name: Test programs
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup
with:
node: ${{ env.NODE_VERSION }}
solana: ${{ env.SOLANA_VERSION }}
- name: Cache test cargo dependencies
uses: actions/cache@v4
with:
path: ${{ env.CARGO_CACHE }}
key: ${{ runner.os }}-cargo-program-tests-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-program-tests
${{ runner.os }}-cargo-programs-${{ hashFiles('**/Cargo.lock') }}
${{ runner.os }}-cargo-programs
- name: Test programs
run: pnpm programs:test

# generate_idls:
# name: Check IDL generation
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# solana: ${{ env.SOLANA_VERSION }}
# - name: Cache cargo dependencies
# uses: actions/cache@v4
# with:
# path: ${{ env.CARGO_CACHE }}
# key: ${{ runner.os }}-cargo-programs-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-cargo-programs
# - name: Cache local cargo dependencies
# uses: actions/cache@v4
# with:
# path: |
# .cargo/bin/
# .cargo/registry/index/
# .cargo/registry/cache/
# .cargo/git/db/
# key: ${{ runner.os }}-cargo-local-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-cargo-local
# - name: Generate IDLs
# run: pnpm generate:idls
# - name: Ensure working directory is clean
# run: test -z "$(git status --porcelain)"
#
# generate_clients:
# name: Check client generation
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# solana: ${{ env.SOLANA_VERSION }}
# - name: Generate clients
# run: pnpm generate:clients
# - name: Ensure working directory is clean
# run: test -z "$(git status --porcelain)"
#
# test_js:
# name: Test JS client
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# solana: ${{ env.SOLANA_VERSION }}
# - name: Restore all builds
# uses: actions/cache/restore@v4
# with:
# path: ./**/*.so
# key: ${{ runner.os }}-builds-${{ github.sha }}
# - name: Test JS client
# run: pnpm clients:js:test
#
# lint_js:
# name: Lint JS client
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# - name: Lint JS client
# run: pnpm clients:js:lint
#
# test_rust:
# name: Test Rust client
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# solana: ${{ env.SOLANA_VERSION }}
# - name: Cache Rust client dependencies
# uses: actions/cache@v4
# with:
# path: ${{ env.CARGO_CACHE }}
# key: ${{ runner.os }}-cargo-rust-client-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-cargo-rust-client
# - name: Restore all builds
# uses: actions/cache/restore@v4
# with:
# path: ./**/*.so
# key: ${{ runner.os }}-builds-${{ github.sha }}
# - name: Test Rust client
# run: pnpm clients:rust:test
#
# lint_rust:
# name: Lint Rust client
# needs: build_programs
# runs-on: ubuntu-latest
# steps:
# - name: Git checkout
# uses: actions/checkout@v4
# - name: Setup environment
# uses: ./.github/actions/setup
# with:
# node: ${{ env.NODE_VERSION }}
# - name: Lint Rust client
# run: pnpm clients:rust:lint
17 changes: 5 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ borsh = "1.5.1"
shank = "0.4.2"
num-derive = "0.4.2"
num-traits = "0.2.19"
solana-program = "1.18.16"
thiserror = "1.0.61"
serde = "1.0.202"
serde_with = "3.8.1"
assert_matches = "1.5.0"
solana-program = "1.18.16"
solana-program-test = "1.18.16"
solana-sdk = "1.18.16"
solana-client = "1.18.16"
Expand All @@ -34,6 +34,6 @@ ed25519-dalek = "1.0.1"
libsecp256k1 = "0.7.1"
clap = "4.5.4"
arrayref = "*"
curve25519-dalek = { version = "4.1.2", default-features = false }
curve25519-dalek = { version = "4.1.3", default-features = false }
sha2 = "0.10.8"
hex = "0.4.3"
2 changes: 1 addition & 1 deletion clients/js/dist/src/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clients/js/dist/src/index.mjs.map

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions clients/js/dist/test/_setup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/js/dist/test/_setup.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions clients/js/dist/test/create.test.js

This file was deleted.

Loading

0 comments on commit 3f72439

Please sign in to comment.