-
Notifications
You must be signed in to change notification settings - Fork 0
ci(nix): use nix profile install instead of nix develop #100
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 all commits
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,14 @@ | ||||||||||||||||||||||
| name: "Setup Nix" | ||||||||||||||||||||||
| description: "Install Nix and configure Cachix" | ||||||||||||||||||||||
| description: "Install Nix and configure cache" | ||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||
| tools: | ||||||||||||||||||||||
| description: 'Space-separated list of nixpkgs packages to install (e.g., "uv ty just")' | ||||||||||||||||||||||
| required: false | ||||||||||||||||||||||
| default: "uv ty just" | ||||||||||||||||||||||
| skip-uv-sync: | ||||||||||||||||||||||
| description: "Skip uv sync step (useful for jobs that do not need Python dependencies)" | ||||||||||||||||||||||
| required: false | ||||||||||||||||||||||
| default: "false" | ||||||||||||||||||||||
| runs: | ||||||||||||||||||||||
| using: "composite" | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
|
|
@@ -8,12 +17,34 @@ runs: | |||||||||||||||||||||
| with: | ||||||||||||||||||||||
| github_access_token: ${{ github.token }} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Setup Cachix (numtide) | ||||||||||||||||||||||
| uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| name: numtide | ||||||||||||||||||||||
| authToken: "" | ||||||||||||||||||||||
| - name: Install tools from nixpkgs | ||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| tools="${{ inputs.tools }}" | ||||||||||||||||||||||
| packages="" | ||||||||||||||||||||||
| for tool in $tools; do | ||||||||||||||||||||||
| packages="$packages nixpkgs#$tool" | ||||||||||||||||||||||
| done | ||||||||||||||||||||||
| nix profile install --inputs-from . $packages | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Initialise git submodules | ||||||||||||||||||||||
| if: inputs.skip-uv-sync != 'true' | ||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| # Only initialise if submodules exist but are not yet checked out | ||||||||||||||||||||||
|
Comment on lines
+30
to
+34
|
||||||||||||||||||||||
| - name: Initialise git submodules | |
| if: inputs.skip-uv-sync != 'true' | |
| shell: bash | |
| run: | | |
| # Only initialise if submodules exist but are not yet checked out | |
| - name: Initialize git submodules | |
| if: inputs.skip-uv-sync != 'true' | |
| shell: bash | |
| run: | | |
| # Only initialize if submodules exist but are not yet checked out |
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.
P2: pnpm is invoked but not installed by the action’s default tool set, so this step will fail on runners without pnpm. Add pnpm to the installed tools or install it before running the command.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/setup-nix/action.yaml, line 49:
<comment>`pnpm` is invoked but not installed by the action’s default tool set, so this step will fail on runners without pnpm. Add pnpm to the installed tools or install it before running the command.</comment>
<file context>
@@ -8,12 +17,34 @@ runs:
- run: nix develop --command true
+ run: |
+ if [ -f vendor/stackone-ai-node/package.json ]; then
+ cd vendor/stackone-ai-node && pnpm install --frozen-lockfile
+ fi
</file context>
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,20 +26,18 @@ jobs: | |||||||
|
|
||||||||
| - name: Setup Nix | ||||||||
| uses: ./.github/actions/setup-nix | ||||||||
| with: | ||||||||
| tools: gitleaks | ||||||||
| skip-uv-sync: "true" | ||||||||
|
|
||||||||
| - name: Run Gitleaks | ||||||||
| run: nix develop --command just gitleaks | ||||||||
| run: gitleaks detect --source . --config .gitleaks.toml | ||||||||
|
|
||||||||
| ci: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| strategy: | ||||||||
| matrix: | ||||||||
| python-version: ["3.11", "3.13"] | ||||||||
|
Comment on lines
38
to
40
|
||||||||
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.13"] |
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.
The
packagesvariable accumulates leading whitespace in the loop (line 26). This could cause issues with some shell configurations. Consider using an array instead:packages=()andpackages+=(\"nixpkgs#$tool\"), then invoke withnix profile install --inputs-from . \"${packages[@]}\".