Skip to content

Commit 1cc4144

Browse files
Merge pull request #6 from jordangarrison/fix-pipeline
fix: update stale Nix deps hash and add build CI job
2 parents 01c3205 + f16908c commit 1cc4144

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,23 @@ jobs:
3030
- name: Run tests
3131
run: nix develop --command bash -c "mix deps.get && mix format --check-formatted && mix test"
3232

33+
build:
34+
name: Nix Build
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: DeterminateSystems/nix-installer-action@v21
39+
- uses: DeterminateSystems/magic-nix-cache-action@v13
40+
- name: Build Nix package
41+
run: nix build .#default
42+
- name: Build Docker image
43+
run: nix build .#dockerImage
44+
3345
deploy:
3446
name: Build & Push Container
3547
runs-on: ubuntu-latest
3648
if: github.event_name == 'push'
37-
needs: [test]
49+
needs: [test, build]
3850
permissions:
3951
contents: read
4052
packages: write

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ custom classes must fully style the input
4444
- Focus on **delightful details** like hover effects, loading states, and smooth page transitions
4545

4646

47+
## Nix build & dependency management
48+
49+
This project is packaged with Nix (`nix/package.nix`) and deployed as a Docker image (`nix/docker.nix`). The Nix package uses `fetchMixDeps` with a **pinned hash** for reproducibility.
50+
51+
**When you add, remove, or update deps in `mix.exs`:**
52+
1. Run `nix build .#default` — if the hash is stale, the build will fail with a hash mismatch showing the correct `got:` value
53+
2. Update the `hash` in `nix/package.nix` with the new value
54+
3. Run `nix build .#default` again to confirm it succeeds
55+
4. Run `nix build .#dockerImage` to confirm the container image builds
56+
57+
**Always validate both nix builds before committing dependency changes.**
58+
4759
## Structured Logging (Wide Events)
4860

4961
This project uses structured wide event logging via `Greenlight.WideEvent` with LoggerJSON. Every logical operation emits a single JSON event with accumulated context. Use the `greenlight-debugging` skill when diagnosing issues.

nix/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let
1616
mixFodDeps = fetchMixDeps {
1717
pname = "${pname}-mix-deps";
1818
inherit version src;
19-
hash = "sha256-Wbv2hJLD1Wwcp+CmMuNuT5GB0BVKccHCjzDhBZpysso=";
19+
hash = "sha256-ekvwtyOduUlUdoIO8s359yDLGGq2VDRzMVvYG8AJVz0=";
2020
};
2121

2222
npmDeps = fetchNpmDeps {

0 commit comments

Comments
 (0)