-
Notifications
You must be signed in to change notification settings - Fork 20
CI: Add program and all extra steps #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Problem The token program now lives in its program-specific repo, but no part of it is being exercised by CI. #### Summary of changes Integrate the token program properly into CI. This includes: * add it to the Cargo workspace, and removing spl-token-client, since it's currently empty * run lint / format / test on the program * run spellcheck / audit / semver checks on the Rust packages * move rust scripts to `scripts/rust` and make them reusable * update to Solana 2.1 and proper rust toolchains
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
febo
approved these changes
Dec 18, 2024
joncinque
added a commit
to joncinque/token
that referenced
this pull request
Feb 3, 2025
* CI: Add program and all extra steps #### Problem The token program now lives in its program-specific repo, but no part of it is being exercised by CI. #### Summary of changes Integrate the token program properly into CI. This includes: * add it to the Cargo workspace, and removing spl-token-client, since it's currently empty * run lint / format / test on the program * run spellcheck / audit / semver checks on the Rust packages * move rust scripts to `scripts/rust` and make them reusable * update to Solana 2.1 and proper rust toolchains * Move JS scripts around, build program too
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The token program now lives in its program-specific repo, but no part of it is being exercised by CI.
Summary of changes
Integrate the token program properly into CI. This includes:
scripts/rust
and make them reusablescripts/js