Skip to content

Commit a5f5878

Browse files
committed
feat: add ci
1 parent 379fd62 commit a5f5878

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.github/workflows/ci-lazer-anchor.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Lazer Solana contract test"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
paths:
8+
- lazer/solana-anchor/
9+
- .github/workflows/ci-lazer-anchor.yml
10+
11+
jobs:
12+
lazer-anchor-example-test:
13+
name: Lazer Anchor example contract test
14+
runs-on: ubuntu-22.04
15+
defaults:
16+
run:
17+
working-directory: lazer/solana-anchor/
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions-rust-lang/setup-rust-toolchain@v1
21+
with:
22+
toolchain: 1.82.0
23+
- name: install taplo
24+
run: cargo install --locked taplo-cli@0.9.3
25+
# Libusb is a build requirement for the node-hid package and so pnpm
26+
# install will fail if this isn't in the build environment and if a
27+
# precompiled binary isn't found.
28+
- name: Install libusb
29+
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
30+
- uses: pnpm/action-setup@v4
31+
name: Install pnpm
32+
with:
33+
run_install: true
34+
- name: Install Solana Cli
35+
run: |
36+
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
37+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
38+
- name: Set Solana Cli version
39+
run: agave-install init 1.18.26
40+
- name: Create Solana key
41+
run: solana-keygen new --no-bip39-passphrase
42+
- name: Install Anchor
43+
run: |
44+
rustup install 1.79.0
45+
rustup install nightly-2025-04-15
46+
RUSTFLAGS= cargo +1.79.0 install --git https://github.com/coral-xyz/anchor --tag v0.30.1 --locked anchor-cli
47+
- name: Run anchor tests
48+
run: anchor test

lazer/solana-anchor/programs/solana-anchor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use pyth_lazer_solana_contract::protocol::{
55
router::channel_ids::FIXED_RATE_200,
66
};
77

8-
declare_id!("My11111111111111111111111111111111111111111");
8+
declare_id!("FpmpVrP57C6ADT8d4dQp9TkM1vmxohZJ5WEQQc9RGLPY");
99

1010
#[program]
1111
pub mod solana_anchor {

lazer/solana-anchor/tests/solana-anchor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe("solana-anchor", () => {
1010

1111
it("Is initialized!", async () => {
1212
// Add your test here.
13-
const tx = await program.methods.initialize().rpc();
13+
const tx = await program.methods.initialize(1).rpc();
1414
console.log("Your transaction signature", tx);
1515
});
1616
});

0 commit comments

Comments
 (0)