Skip to content

Commit 91e0d9a

Browse files
authored
Align repo orchestration with solana-program conventions (#79)
* Align repo orchestration with solana-program conventions This PR replaces system's bespoke `vars.env` + hand-rolled `Makefile` + in-repo composite setup action + per-repo publish workflows with the converged `solana-program/*` orchestration: a `Makefile` modelled on `program-metadata`'s, thin CI wrappers that delegate to reusable workflows in `solana-program/actions`, and `Cargo.toml`'s `[workspace.metadata]` blocks as the single source of truth for the nightly toolchain and Solana CLI version. The reusable workflows bring uniform format/lint/test/docs/powerset gates for free, NPM provenance and `cargo semver-checks` for publishing, and eliminate the need to maintain per-repo orchestration. The JS client's `test-js-%` target stays LiteSVM-flavoured (no validator dance) and `codama.mjs` reads the nightly from the Makefile so the toolchain pin lives in exactly one place. Repo admins will need to provision the `vars.APP_ID` + `secrets.PRIVATE_KEY` GitHub App and the `prod` environment with an NPM Trusted Publisher before the next publish under these workflows. * Fix CI by adding spellcheck plumbing and pinning audit ignores This commit fixes the two CI gates that were left unhandled by the orchestration alignment: spellcheck and audit. The reusable workflow at `solana-program/actions/.github/workflows/main.yml@main` runs `make spellcheck` and `make audit` unconditionally on every push, so both targets need to be present and pass. The spellcheck target is now wired up the same way as in `program-metadata` and `stake`, with a `scripts/spellcheck.toml` config and a `scripts/solana.dic` dictionary seeded from the union of both reference repos. The audit ignore list has been replaced with the set of RUSTSEC IDs that system's wider transitive dependency tree triggers (all in the `solana-client` RPC / TLS / pubsub stack), captured from a local run against an upgraded `cargo-audit` that understands CVSS 4.0. * Make cargo-spellcheck actually load the custom dictionary * Remove unnecessary cargo audit ignores
1 parent 2e9bd5e commit 91e0d9a

21 files changed

Lines changed: 484 additions & 606 deletions

.github/actions/setup/action.yml

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

.github/workflows/main.yml

Lines changed: 30 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,98 +5,41 @@ on:
55
branches: [main]
66
pull_request:
77

8-
jobs:
9-
format_and_lint_client_js:
10-
name: Format & Lint Client JS
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Git Checkout
14-
uses: actions/checkout@v4
15-
16-
- name: Setup Environment
17-
uses: ./.github/actions/setup
18-
with:
19-
pnpm: true
20-
21-
- name: Format Client JS
22-
run: make format-js
23-
24-
- name: Lint Client JS
25-
run: make lint-js
26-
27-
format_and_lint_client_rust:
28-
name: Format & Lint Client Rust
29-
runs-on: ubuntu-latest
30-
steps:
31-
- name: Git Checkout
32-
uses: actions/checkout@v4
33-
34-
- name: Setup Environment
35-
uses: ./.github/actions/setup
36-
with:
37-
toolchain: format, lint
38-
39-
- name: Format
40-
run: make format-clients-rust
41-
42-
- name: Lint / Clippy
43-
run: make clippy-clients-rust
44-
45-
- name: Lint / Docs
46-
run: make lint-docs-clients-rust
8+
env:
9+
JS_PACKAGES: "['clients-js']"
10+
RUST_PACKAGES: "['clients-rust']"
4711

48-
- name: Lint / Features
49-
run: make lint-features-clients-rust
50-
51-
generate_clients:
52-
name: Check Client Generation
12+
jobs:
13+
set_env:
14+
name: Set variables to be used in strategy definitions in reusable workflow
5315
runs-on: ubuntu-latest
16+
outputs:
17+
JS_PACKAGES: ${{ steps.compute.outputs.JS_PACKAGES }}
18+
RUST_PACKAGES: ${{ steps.compute.outputs.RUST_PACKAGES }}
19+
RUST_TOOLCHAIN_NIGHTLY: ${{ steps.compute.outputs.RUST_TOOLCHAIN_NIGHTLY }}
20+
SOLANA_CLI_VERSION: ${{ steps.compute.outputs.SOLANA_CLI_VERSION }}
5421
steps:
5522
- name: Git Checkout
56-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
5724

5825
- name: Setup Environment
59-
uses: ./.github/actions/setup
60-
with:
61-
pnpm: true
62-
toolchain: format
63-
64-
- name: Generate Clients
65-
run: make generate-clients
26+
uses: solana-program/actions/setup-ubuntu@main
6627

67-
- name: Check Working Directory
28+
- name: Compute variables
29+
id: compute
30+
shell: bash
6831
run: |
69-
git status --porcelain
70-
test -z "$(git status --porcelain)"
71-
72-
test_client_js:
73-
name: Test Client JS
74-
runs-on: ubuntu-latest
75-
steps:
76-
- name: Git Checkout
77-
uses: actions/checkout@v4
78-
79-
- name: Setup Environment
80-
uses: ./.github/actions/setup
81-
with:
82-
pnpm: true
83-
84-
- name: Test Client JS
85-
run: make test-js
86-
87-
test_client_rust:
88-
name: Test Client Rust
89-
runs-on: ubuntu-latest
90-
steps:
91-
- name: Git Checkout
92-
uses: actions/checkout@v4
93-
94-
- name: Setup Environment
95-
uses: ./.github/actions/setup
96-
with:
97-
cargo-cache-key: cargo-rust-client
98-
toolchain: test
99-
solana: true
100-
101-
- name: Test Client Rust
102-
run: make test-clients-rust
32+
echo "JS_PACKAGES=${{ env.JS_PACKAGES }}" >> $GITHUB_OUTPUT
33+
echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT
34+
echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT"
35+
echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT"
36+
37+
main:
38+
needs: set_env
39+
uses: solana-program/actions/.github/workflows/main.yml@main
40+
with:
41+
js-packages: ${{ needs.set_env.outputs.JS_PACKAGES }}
42+
rust-packages: ${{ needs.set_env.outputs.RUST_PACKAGES }}
43+
rustfmt-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
44+
clippy-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
45+
solana-cli-version: ${{ needs.set_env.outputs.SOLANA_CLI_VERSION }}

.github/workflows/publish-js-client.yml

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

0 commit comments

Comments
 (0)