Skip to content

Commit 439c9e7

Browse files
authored
V2 DataFeeds1 SDK (#1352)
* initial * bump version * remove anchor-lang dependency * use anchor 0.29.0 just for tests * stay on v3 lockfile * version * pin solana-program * add deps * bump solana-program * bump again * pin * try 2.3.0 * downgrade solana-program * lint * tidy up * lint * seperately build sdk * add new test * fix hashfiles
1 parent 8b75d1c commit 439c9e7

File tree

10 files changed

+2597
-136
lines changed

10 files changed

+2597
-136
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ jobs:
4444
uses: actions/cache@v4
4545
with:
4646
path: contracts/target
47-
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
47+
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('contracts/**/Cargo.lock') }}
4848
- name: Cache hello-world target dir
4949
uses: actions/cache@v4
5050
with:
5151
path: contracts/examples/hello-world/target
52-
key: ${{ runner.os }}-v2-cargo-build-target-hello-world-${{ hashFiles('**/Cargo.lock') }}
52+
key: ${{ runner.os }}-v2-cargo-build-target-hello-world-${{ hashFiles('contracts/**/Cargo.lock') }}
5353
- name: cache docker build image
5454
id: cache-image
5555
uses: actions/cache@v4
5656
with:
5757
path: contracts/docker-build.tar
58-
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}
58+
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('contracts/**/Cargo.lock') }}
5959
- name: load cached image
6060
run: |
6161
docker load --input docker-build.tar
@@ -89,13 +89,13 @@ jobs:
8989
uses: actions/cache@v4
9090
with:
9191
path: contracts/target
92-
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
92+
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('contracts/**/Cargo.lock') }}
9393
- name: cache docker build image
9494
id: cache-image
9595
uses: actions/cache@v4
9696
with:
9797
path: contracts/docker-build.tar
98-
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}
98+
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('contracts/**/Cargo.lock') }}
9999
- name: load cached image
100100
run: |
101101
docker load --input docker-build.tar
@@ -133,15 +133,15 @@ jobs:
133133
uses: actions/cache@v4
134134
with:
135135
path: contracts/target
136-
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
136+
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('contracts/**/Cargo.lock') }}
137137

138138
- name: cache docker build image
139139
id: cache-image
140140
uses: actions/cache@v4
141141
with:
142142
fail-on-cache-miss: true
143143
path: contracts/docker-build.tar
144-
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}
144+
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('contracts/**/Cargo.lock') }}
145145

146146
- name: load cached image
147147
run: |

.github/workflows/sdk-test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: SDK Tests and Build
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'sdk/chainlink-solana/**'
8+
- '.github/workflows/sdk-test.yml'
9+
pull_request:
10+
branches: [ main, develop ]
11+
paths:
12+
- 'sdk/chainlink-solana/**'
13+
14+
permissions:
15+
contents: read
16+
pull-requests: read
17+
18+
jobs:
19+
test-and-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install Rust toolchain
27+
uses: dtolnay/rust-toolchain@351f82a4dc29e4159746a068ed925da17341219f
28+
with:
29+
toolchain: stable
30+
components: rustfmt, clippy
31+
32+
- name: Cache Cargo dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
~/.cargo/registry
37+
~/.cargo/git
38+
sdk/chainlink-solana/target
39+
key: ${{ runner.os }}-cargo-${{ hashFiles('sdk/chainlink-solana/Cargo.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-cargo-
42+
43+
- name: Check formatting
44+
run: cargo fmt --check
45+
working-directory: sdk/chainlink-solana
46+
47+
- name: Run Clippy
48+
run: cargo clippy -- -D warnings
49+
working-directory: sdk/chainlink-solana
50+
51+
- name: Run tests
52+
run: cargo test --verbose
53+
working-directory: sdk/chainlink-solana
54+
55+
- name: Build release
56+
run: cargo build --release
57+
working-directory: sdk/chainlink-solana

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pkg/bin
99

1010
v1/target
1111

12+
sdk/*/target
1213
contracts/target
1314
contracts/programs/*/target
1415
contracts/.anchor

contracts/Cargo.lock

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

contracts/crates/chainlink-solana/src/lib.rs

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)