-
Notifications
You must be signed in to change notification settings - Fork 3
chore: modernize to latest rainix (flake + CI) #141
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
base: main
Are you sure you want to change the base?
Changes from all commits
a65b0f7
b86cc5e
cff67b3
d79cab0
487a698
b6feae7
809dc5a
76df6f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Package Release | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| release: | ||
| # Auto-publishes the dotrain crates to crates.io and the @rainlanguage/dotrain | ||
| # npm package on every merge to main, version-bumped in lockstep by the shared | ||
| # rainix-autopublish reusable — the same merge-driven model every other rain repo | ||
| # uses. Replaces the old manual `workflow_dispatch` release. | ||
| uses: rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@main | ||
| with: | ||
| crates: dotrain dotrain-lsp | ||
| npm-package: "@rainlanguage/dotrain" | ||
| secrets: inherit | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,38 +1,25 @@ | ||||||||||||||||||||
| name: Rainix CI | ||||||||||||||||||||
| name: rainix-rs | ||||||||||||||||||||
| on: [push] | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
|
Comment on lines
+1
to
3
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. Declare explicit least-privilege This workflow currently relies on default Suggested hardening name: rainix-rs
on: [push]
+permissions:
+ contents: read
jobs:
static:📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 1-26: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 2-2: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting (concurrency-limits) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||
| rainix: | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| os: [ubuntu-latest, macos-latest] | ||||||||||||||||||||
| task: [rainix-rs-test, rainix-rs-artifacts] | ||||||||||||||||||||
| include: | ||||||||||||||||||||
| # We don't need to do rust static analysis on multiple platforms | ||||||||||||||||||||
| - os: ubuntu-latest | ||||||||||||||||||||
| task: rainix-rs-static | ||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| static: | ||||||||||||||||||||
| uses: rainlanguage/rainix/.github/workflows/rainix-rs-static.yaml@main | ||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||
| test: | ||||||||||||||||||||
| uses: rainlanguage/rainix/.github/workflows/rainix-rs-test.yaml@main | ||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||
| js-bindings: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||
| # Shared rainix nix + cachix CI preamble (checkout, nix-quick-install, | ||||||||||||||||||||
| # Cachix, cache-nix-action) — the pinned action SHAs live once in the | ||||||||||||||||||||
| # composite, matching every rainix reusable. The build/test/docs commands | ||||||||||||||||||||
| # below are dotrain-specific flake devShell tasks (npm + wasm-bindgen CLI | ||||||||||||||||||||
| # over the js-api crate, mocha tests, api-extractor docs), so there is no | ||||||||||||||||||||
| # rainix reusable workflow that runs them; only the preamble is shared. | ||||||||||||||||||||
| - uses: rainlanguage/rainix/.github/actions/nix-cachix-setup@main | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| submodules: recursive | ||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - uses: DeterminateSystems/nix-installer-action@v4 | ||||||||||||||||||||
| - uses: DeterminateSystems/magic-nix-cache-action@v2 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - run: nix develop -c rainix-rs-prelude | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run ${{ matrix.task }} | ||||||||||||||||||||
| run: nix develop -c ${{ matrix.task }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build JS Bindings | ||||||||||||||||||||
| run: nix develop -c build-js-bindings | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run JS Tests | ||||||||||||||||||||
| run: nix develop -c test-js-bindings | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Test JS Doc Generation | ||||||||||||||||||||
| run: nix develop -c js-bindings-docs | ||||||||||||||||||||
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||||||||||||||||||||
| - uses: rainlanguage/rainix/.github/actions/rust-cache@main | ||||||||||||||||||||
|
Comment on lines
+5
to
+22
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. 🧩 Analysis chain🏁 Script executed: find .github/workflows -type f -name "*.yaml" -o -name "*.yml" | head -20Repository: rainlanguage/dotrain Length of output: 169 🏁 Script executed: cat -n .github/workflows/rainix.yamlRepository: rainlanguage/dotrain Length of output: 1354 🏁 Script executed: cat -n .github/workflows/manual-release.yamlRepository: rainlanguage/dotrain Length of output: 6932 Pin all action and reusable workflow references to immutable commit SHAs, not
🧰 Tools🪛 zizmor (1.25.2)[warning] 7-9: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 5-5: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 8-8: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 22-22: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [warning] 5-5: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow (secrets-inherit) [warning] 8-8: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow (secrets-inherit) [info] 10-10: workflow or action definition without a name (anonymous-definition): this job (anonymous-definition) 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||
| - run: nix develop -c build-js-bindings | ||||||||||||||||||||
| - run: nix develop -c test-js-bindings | ||||||||||||||||||||
| - run: nix develop -c js-bindings-docs | ||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: rainlanguage/dotrain
Length of output: 105
Pin the reusable workflow to a specific commit hash instead of using
@main.Line 12 uses
@main, which allows upstream changes to the reusable workflow in rainlanguage/rainix to alter publish behavior without explicit review. Pin to a specific commit hash:This ensures the workflow definition is immutable and prevents unreviewed behavioral changes.
🧰 Tools
🪛 zizmor (1.25.2)
[error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[warning] 12-12: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
🤖 Prompt for AI Agents