Repository navigation
chore: Align Rust toolchain & CI with chain repo #72
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
Changes from 3 commits
f071686
1e3c327
fa7d4c7
8099a2e
95c135f
8bbe95f
3ed646f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,11 @@ concurrency: | |||||||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||||||||
| cancel-in-progress: true | ||||||||
|
|
||||||||
| # Principle of least privilege: all jobs only read the repo (checkout + cargo). | ||||||||
| # Per-job override is unnecessary because no job pushes, creates releases or PRs. | ||||||||
| permissions: | ||||||||
| contents: read | ||||||||
|
|
||||||||
| env: | ||||||||
| CARGO_INCREMENTAL: 0 | ||||||||
| CARGO_TERM_COLOR: always | ||||||||
|
|
@@ -30,8 +35,10 @@ jobs: | |||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
| - name: Install required components | ||||||||
| run: rustup component add rustfmt --toolchain nightly | ||||||||
| - name: Setup Rust toolchain (pinned via rust-toolchain) | ||||||||
| run: | | ||||||||
| rustup show active-toolchain || rustup show | ||||||||
| rustup component add rustfmt --toolchain nightly | ||||||||
| - name: Install taplo | ||||||||
| run: cargo install taplo-cli --locked | ||||||||
| - name: Run format checks | ||||||||
|
|
@@ -62,6 +69,11 @@ jobs: | |||||||
| if: matrix.os == 'macos-latest' | ||||||||
| run: | | ||||||||
| brew install protobuf | ||||||||
| - name: Setup Rust toolchain (pinned via rust-toolchain) | ||||||||
| run: | | ||||||||
| rustup show active-toolchain || rustup show | ||||||||
| rustc --version | ||||||||
| cargo --version | ||||||||
| - name: Build | ||||||||
| run: cargo build --locked --release | ||||||||
| - name: Test | ||||||||
|
|
@@ -73,15 +85,51 @@ jobs: | |||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
| - name: Install Rust | ||||||||
| - name: Install system dependencies | ||||||||
| run: | | ||||||||
| sudo apt-get update -yqq | ||||||||
| sudo apt-get install -yqq --no-install-recommends \ | ||||||||
| libclang-dev \ | ||||||||
| protobuf-compiler | ||||||||
| - name: Install required components | ||||||||
| run: rustup component add rust-src clippy | ||||||||
| - name: Setup Rust toolchain (pinned via rust-toolchain) | ||||||||
| run: | | ||||||||
| rustup show active-toolchain || rustup show | ||||||||
| rustup component add rust-src clippy | ||||||||
| rustc --version | ||||||||
| cargo --version | ||||||||
| - name: Run clippy | ||||||||
| run: cargo clippy --locked -- -D warnings | ||||||||
| - name: Run doc | ||||||||
| run: cargo doc --locked --no-deps | ||||||||
|
|
||||||||
| security-audit: | ||||||||
| name: 🔐 Security Audit (non-blocking) | ||||||||
| needs: fast-checks | ||||||||
| runs-on: ubuntu-latest | ||||||||
| continue-on-error: true | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
| - name: Setup Rust toolchain (pinned via rust-toolchain) | ||||||||
| run: | | ||||||||
| rustup show active-toolchain || rustup show | ||||||||
| rustc --version | ||||||||
| cargo --version | ||||||||
| - name: Cache cargo-audit binary | ||||||||
| uses: actions/cache@v4 | ||||||||
| with: | ||||||||
| path: ~/.cargo/bin/cargo-audit | ||||||||
| key: cargo-audit-bin-${{ runner.os }} | ||||||||
| - name: Cache RustSec advisory database | ||||||||
| uses: actions/cache@v4 | ||||||||
| with: | ||||||||
| path: ~/.cargo/advisory-db | ||||||||
| key: cargo-advisory-db-${{ runner.os }}-${{ github.run_id }} | ||||||||
| restore-keys: | | ||||||||
| cargo-advisory-db-${{ runner.os }}- | ||||||||
| - name: Install cargo-audit | ||||||||
| run: | | ||||||||
| if ! command -v cargo-audit >/dev/null 2>&1; then | ||||||||
| cargo install cargo-audit --locked | ||||||||
| fi | ||||||||
| - name: Run cargo audit (informational only) | ||||||||
| run: cargo audit | ||||||||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @czareko you mentioned that CodeQL requires switching from default setup to advanced setup... We should add a merge checklist note or issue link for disabling/switching CodeQL default setup once this workflow lands. Current checks show both “CodeQL on: dynamic” and this new workflow running, so we may double-run CodeQL until the repo setting is changed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ethan-crypto, my comment in the test section was outdated. From the repo perspective, everything is now disabled, and the configuration is fully managed from our code. This way, we can keep it consistent across all projects. |
||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| # No scheduled scans by design: every code change reaches main via push or PR, | ||
| # both of which trigger this workflow. Security advisories for Rust dependencies | ||
| # are independently caught by `cargo audit` in ci.yml. | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # `actions` covers GitHub Actions workflow hygiene (e.g. the | ||
| # `actions/missing-workflow-permissions` rule). | ||
| - language: actions | ||
| build-mode: none | ||
| # `rust` is GA since Oct 2025 and supports build-mode `none`, | ||
| # so we get source-level analysis without compiling the workspace. | ||
| # Note: `cargo audit` in ci.yml stays as the authoritative source | ||
| # for known CVEs in dependencies; CodeQL adds taint/quality checks | ||
| # on our own source. | ||
| - language: rust | ||
| build-mode: none | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
| queries: security-and-quality | ||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [toolchain] | ||
| channel = "stable" | ||
| channel = "1.93.0" | ||
| components = ["clippy", "rustfmt"] | ||
| targets = ["wasm32-unknown-unknown"] | ||
| targets = ["wasm32v1-none"] | ||
| profile = "minimal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.