Skip to content

Commit df45825

Browse files
committed
add ci
1 parent 1f0ab50 commit df45825

11 files changed

Lines changed: 128 additions & 58 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Setup Environment
22
description: Setup Rust, Solana CLI, and Light CLI for testing
33

44
inputs:
5+
example:
6+
description: "Example directory path"
7+
required: true
58
solana-cli-version:
69
description: "Solana CLI version"
710
required: false
@@ -22,7 +25,7 @@ runs:
2225
uses: actions-rust-lang/setup-rust-toolchain@v1
2326
with:
2427
toolchain: ${{ inputs.rust-toolchain }}
25-
cache: false
28+
cache-workspaces: ${{ inputs.example }}
2629

2730
- name: Setup Node.js (for Light CLI)
2831
uses: actions/setup-node@v4
@@ -41,7 +44,7 @@ runs:
4144
path: |
4245
~/.cache/solana/
4346
~/.local/share/solana/
44-
key: solana-cli-${{ runner.os }}-${{ inputs.solana-cli-version }}
47+
key: solana-cli-${{ runner.os }}-build-${{ inputs.solana-cli-version }}
4548

4649
- name: Install Solana CLI tools
4750
shell: bash

.github/workflows/rust-tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
branches:
10+
- main
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
SOLANA_CLI_VERSION: "2.3.11"
18+
RUST_TOOLCHAIN: "1.90.0"
19+
20+
jobs:
21+
test-rust:
22+
name: ${{ matrix.name || (matrix.package && format('{0}/{1}', matrix.example, matrix.package)) || matrix.example }}
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
example:
28+
- create-and-update
29+
- counter/native
30+
- counter/pinocchio
31+
- account-comparison
32+
- airdrop-implementations/simple-claim/program
33+
include:
34+
- example: basic-operations/native
35+
package: native-program-burn
36+
- example: basic-operations/native
37+
package: native-program-create
38+
- example: basic-operations/native
39+
package: native-program-update
40+
- example: basic-operations/native
41+
package: native-program-close
42+
- example: basic-operations/native
43+
package: native-program-reinit
44+
- example: anchor
45+
package: escrow
46+
name: anchor escrow
47+
- example: anchor
48+
package: light-token-minter
49+
name: anchor light-token-minter
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Setup environment
54+
uses: ./.github/actions/setup
55+
with:
56+
example: ${{ matrix.example }}
57+
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
58+
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
59+
60+
- name: Build and test
61+
working-directory: ${{ matrix.example }}
62+
run: |
63+
if [ -n "${{ matrix.package }}" ]; then
64+
cargo test-sbf -p ${{ matrix.package }}
65+
else
66+
cargo test-sbf
67+
fi

anchor/Anchor.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ skip-lint = false
66

77
[programs.localnet]
88
escrow = "FKJs6rp6TXJtxzLiPtdYhqa9ExRuBXG2zwh4fda6WATN"
9-
spl_token_minter = "3EPJBoxM8Evtv3Wk7R2mSWsrSzUD7WSKAaYugLgpCitV"
9+
light_token_minter = "3EPJBoxM8Evtv3Wk7R2mSWsrSzUD7WSKAaYugLgpCitV"
1010

1111
[registry]
1212
url = "https://api.apr.dev"

anchor/Cargo.lock

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

anchor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
resolver = "2"
33
members = [
44
"programs/escrow",
5-
"programs/spl-token-minter",
5+
"programs/light-token-minter",
66
]
77

88
[workspace.dependencies]

anchor/programs/spl-token-minter/Cargo.toml renamed to anchor/programs/light-token-minter/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "spl-token-minter"
2+
name = "light-token-minter"
33
version = "0.1.0"
44
edition = "2021"
55

66
[lib]
77
crate-type = ["cdylib", "lib"]
8-
name = "spl_token_minter"
8+
name = "light_token_minter"
99

1010
[features]
1111
no-entrypoint = []

anchor/programs/spl-token-minter/src/instructions/create.rs renamed to anchor/programs/light-token-minter/src/instructions/create.rs

File renamed without changes.

anchor/programs/spl-token-minter/src/instructions/mint.rs renamed to anchor/programs/light-token-minter/src/instructions/mint.rs

File renamed without changes.

anchor/programs/spl-token-minter/src/instructions/mod.rs renamed to anchor/programs/light-token-minter/src/instructions/mod.rs

File renamed without changes.

anchor/programs/spl-token-minter/src/lib.rs renamed to anchor/programs/light-token-minter/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub const MINT_SIGNER_SEED: &[u8] = b"mint_signer";
1919

2020
#[light_program]
2121
#[program]
22-
pub mod spl_token_minter {
22+
pub mod light_token_minter {
2323
use super::*;
2424

2525
pub fn create_mint<'info>(

0 commit comments

Comments
 (0)