Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ on:
workflow_dispatch:
inputs:
version-level:
description: 'Select Version Level'
description: "Select Version Level"
required: true
type: choice
options:
- alpha # Increase the alpha pre-version (x.y.z-alpha.M)
- beta # Increase the beta pre-version (x.y.z-beta.M)
- patch # Increase the patch version (x.y.z)
- minor # Increase the minor version (x.y.0)
- major # Increase the major version (x.0.0)
- alpha # Increase the alpha pre-version (x.y.z-alpha.M)
- beta # Increase the beta pre-version (x.y.z-beta.M)
- patch # Increase the patch version (x.y.z)
- minor # Increase the minor version (x.y.0)
- major # Increase the major version (x.0.0)
- release # Remove the pre-version, ie remove alpha/beta/rc (x.y.z)
- rc # Increase the rc pre-version (x.y.z-rc.M)
- rc # Increase the rc pre-version (x.y.z-rc.M)

jobs:
release:
Expand All @@ -24,11 +24,22 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: nixbuild/nix-quick-install-action@v30
with:
determinate: true
- uses: DeterminateSystems/flakehub-cache-action@main
nix_conf: |
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until the Nix store size (in bytes) is at most this number
# before trying to save a new cache
# 1G = 1073741824
gc-max-store-size-linux: 1G

- run: |
git config --global user.email "${{ secrets.CI_GIT_EMAIL }}"
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/rainix.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Rainix CI
on: [push]

concurrency:
group: ${{ github.ref }}-rainix
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
standard-tests:
strategy:
Expand All @@ -22,9 +26,22 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: nixbuild/nix-quick-install-action@v30
with:
nix_conf: |
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until the Nix store size (in bytes) is at most this number
# before trying to save a new cache
# 1G = 1073741824
gc-max-store-size-linux: 1G

- run: nix develop --command rainix-rs-prelude
- name: Run ${{ matrix.task }}
Expand All @@ -34,4 +51,4 @@ jobs:
run: nix develop --command ${{ matrix.task }}

- name: Build for wasm target
run: nix develop -c cargo build --target wasm32-unknown-unknown
run: nix develop -c cargo build --target wasm32-unknown-unknown
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Ensure consistent Nix CLI options
Other steps use --command, whereas here you’re using -c. For consistency—and to avoid confusion—you may want to switch to the long-form flag:

-run: nix develop -c cargo build --target wasm32-unknown-unknown
+run: nix develop --command cargo build --target wasm32-unknown-unknown
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: nix develop -c cargo build --target wasm32-unknown-unknown
run: nix develop --command cargo build --target wasm32-unknown-unknown
🤖 Prompt for AI Agents
In .github/workflows/rainix.yaml at line 54, replace the short-form Nix CLI
option '-c' with the long-form '--command' to maintain consistency with other
steps. Change the command to use '--command' before 'cargo build --target
wasm32-unknown-unknown' to align with the rest of the workflow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both versions are fine

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xgleb, understood! I'll note that both -c and --command are acceptable for Nix CLI options in this codebase.

      (\   /)
     ( ._.)
    o_(")(")

✏️ Learnings added
Learnt from: 0xgleb
PR: rainlanguage/rain.error#17
File: .github/workflows/rainix.yaml:54-54
Timestamp: 2025-05-29T19:50:09.099Z
Learning: In the rainlanguage/rain.error repository, both short-form `-c` and long-form `--command` are acceptable for Nix CLI options in GitHub workflows, and consistency between them is not required.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.