Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Test Bounty Program

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

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/v1.17.0/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
solana --version

- name: Cache Cargo registry and git directories
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} # General key, Anchor's lock is not in this repo
restore-keys: |
${{ runner.os }}-cargo-

- name: Install Anchor
run: |
cargo install --git https://github.com/coral-xyz/anchor anchor-cli --locked --force
anchor --version

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: chain/tra-bounty/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('chain/tra-bounty/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install project dependencies
working-directory: ./chain/tra-bounty
run: npm install

- name: Build Anchor program
working-directory: ./chain/tra-bounty
run: anchor build

- name: Run Anchor tests
working-directory: ./chain/tra-bounty
run: anchor test
2 changes: 1 addition & 1 deletion chain/tra-bounty/tests/tra-bounty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe("tra-bounty", () => {
// Helper to get Bounty state struct size if not directly available in JS/TS types
// This is a placeholder; actual size calculation is in state.rs
class Bounty {
static MAX_SIZE = 1024; // Estimate, use actual from state.rs if possible
static MAX_SIZE = 1714; // Estimate, use actual from state.rs if possible
}

});
Expand Down
Loading