Skip to content

Commit 499a7f1

Browse files
committed
Move JS scripts around, build program too
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ff7d1e..46166f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -142,10 +142,40 @@ jobs: git status --porcelain test -z "$(git status --porcelain)" + build_program: + name: Build Program + runs-on: ubuntu-latest + needs: format_and_lint_program + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Setup Environment + uses: ./.github/actions/setup + with: + cargo-cache-key: cargo-build-program + solana: true + + - name: Build + 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 Program Builds For Client Jobs + uses: actions/cache/save@v4 + with: + path: ./**/*.so + key: ${{ runner.os }}-builds-${{ github.sha }} + test_client_js: name: Test Client JS runs-on: ubuntu-latest - needs: format_and_lint_client_js + needs: [format_and_lint_client_js, build_program] steps: - name: Git Checkout uses: actions/checkout@v4 @@ -155,6 +185,12 @@ jobs: with: solana: true + - name: Restore Program Builds + uses: actions/cache/restore@v4 + with: + path: ./**/*.so + key: ${{ runner.os }}-builds-${{ github.sha }} + - name: Test Client JS run: pnpm clients:js:test @@ -187,7 +223,7 @@ jobs: - name: Setup Environment uses: ./.github/actions/setup with: - cargo-cache-key: cargo-rust-client + cargo-cache-key: cargo-test-program solana: true - name: Test diff --git a/package.json b/package.json index d9827dc..9a3d3fb 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "validator:start": "zx ./scripts/start-validator.mjs", "validator:restart": "pnpm validator:start --restart", "validator:stop": "zx ./scripts/stop-validator.mjs", - "clients:js:format": "zx ./scripts/client/format-js.mjs", - "clients:js:lint": "zx ./scripts/client/lint-js.mjs", - "clients:js:publish": "zx ./scripts/client/publish-js.mjs", - "clients:js:test": "zx ./scripts/client/test-js.mjs", + "clients:js:format": "zx ./scripts/js/format.mjs", + "clients:js:lint": "zx ./scripts/js/lint.mjs", + "clients:js:publish": "zx ./scripts/js/publish.mjs", + "clients:js:test": "zx ./scripts/js/test.mjs", "clients:rust:format": "zx ./scripts/rust/format.mjs clients/rust", "clients:rust:lint": "zx ./scripts/rust/lint.mjs clients/rust", "clients:rust:publish": "zx ./scripts/rust/publish.mjs clients/rust", diff --git a/program/Cargo.toml b/program/Cargo.toml index 95f5e97..cfff306 100644 --- a/program/Cargo.toml +++ b/program/Cargo.toml @@ -35,3 +35,6 @@ targets = ["x86_64-unknown-linux-gnu"] [lints] workspace = true + +[package.metadata.solana] +program-id = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" diff --git a/scripts/client/format-js.mjs b/scripts/js/format.mjs similarity index 100% rename from scripts/client/format-js.mjs rename to scripts/js/format.mjs diff --git a/scripts/client/lint-js.mjs b/scripts/js/lint.mjs similarity index 100% rename from scripts/client/lint-js.mjs rename to scripts/js/lint.mjs diff --git a/scripts/client/publish-js.mjs b/scripts/js/publish.mjs similarity index 100% rename from scripts/client/publish-js.mjs rename to scripts/js/publish.mjs diff --git a/scripts/client/test-js.mjs b/scripts/js/test.mjs similarity index 100% rename from scripts/client/test-js.mjs rename to scripts/js/test.mjs
1 parent b38938e commit 499a7f1

File tree

7 files changed

+45
-6
lines changed

7 files changed

+45
-6
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,40 @@ jobs:
142142
git status --porcelain
143143
test -z "$(git status --porcelain)"
144144
145+
build_program:
146+
name: Build Program
147+
runs-on: ubuntu-latest
148+
needs: format_and_lint_program
149+
steps:
150+
- name: Git Checkout
151+
uses: actions/checkout@v4
152+
153+
- name: Setup Environment
154+
uses: ./.github/actions/setup
155+
with:
156+
cargo-cache-key: cargo-build-program
157+
solana: true
158+
159+
- name: Build
160+
run: pnpm programs:build
161+
162+
- name: Upload Program Builds
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: program-builds
166+
path: ./target/deploy/*.so
167+
if-no-files-found: error
168+
169+
- name: Save Program Builds For Client Jobs
170+
uses: actions/cache/save@v4
171+
with:
172+
path: ./**/*.so
173+
key: ${{ runner.os }}-builds-${{ github.sha }}
174+
145175
test_client_js:
146176
name: Test Client JS
147177
runs-on: ubuntu-latest
148-
needs: format_and_lint_client_js
178+
needs: [format_and_lint_client_js, build_program]
149179
steps:
150180
- name: Git Checkout
151181
uses: actions/checkout@v4
@@ -155,6 +185,12 @@ jobs:
155185
with:
156186
solana: true
157187

188+
- name: Restore Program Builds
189+
uses: actions/cache/restore@v4
190+
with:
191+
path: ./**/*.so
192+
key: ${{ runner.os }}-builds-${{ github.sha }}
193+
158194
- name: Test Client JS
159195
run: pnpm clients:js:test
160196

@@ -187,7 +223,7 @@ jobs:
187223
- name: Setup Environment
188224
uses: ./.github/actions/setup
189225
with:
190-
cargo-cache-key: cargo-rust-client
226+
cargo-cache-key: cargo-test-program
191227
solana: true
192228

193229
- name: Test

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"validator:start": "zx ./scripts/start-validator.mjs",
1313
"validator:restart": "pnpm validator:start --restart",
1414
"validator:stop": "zx ./scripts/stop-validator.mjs",
15-
"clients:js:format": "zx ./scripts/client/format-js.mjs",
16-
"clients:js:lint": "zx ./scripts/client/lint-js.mjs",
17-
"clients:js:publish": "zx ./scripts/client/publish-js.mjs",
18-
"clients:js:test": "zx ./scripts/client/test-js.mjs",
15+
"clients:js:format": "zx ./scripts/js/format.mjs",
16+
"clients:js:lint": "zx ./scripts/js/lint.mjs",
17+
"clients:js:publish": "zx ./scripts/js/publish.mjs",
18+
"clients:js:test": "zx ./scripts/js/test.mjs",
1919
"clients:rust:format": "zx ./scripts/rust/format.mjs clients/rust",
2020
"clients:rust:lint": "zx ./scripts/rust/lint.mjs clients/rust",
2121
"clients:rust:publish": "zx ./scripts/rust/publish.mjs clients/rust",

program/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ targets = ["x86_64-unknown-linux-gnu"]
3535

3636
[lints]
3737
workspace = true
38+
39+
[package.metadata.solana]
40+
program-id = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)