Compare commits

...

109 Commits

Author SHA1 Message Date
Luc Perkins aa0e540080 Merge pull request #252 from detsys-pr-bot/detsys-ts-update-bc7c106804f775f17c754b620f1dfd23add68e03
CI / tests (push) Blocked by required conditions
CI / Test: ${{ matrix.system.nix-system }} on ${{ matrix.system.runner }}${{ matrix.determinate && ' with determinate' || '' }} (false, map[nix-system:aarch64-darwin runner:macos-latest]) (push) Waiting to run
CI / Test: ${{ matrix.system.nix-system }} on ${{ matrix.system.runner }}${{ matrix.determinate && ' with determinate' || '' }} (false, map[nix-system:x86_64-linux runner:nscloud-ubuntu-22.04-amd64-4x16]) (push) Waiting to run
CI / Test: ${{ matrix.system.nix-system }} on ${{ matrix.system.runner }}${{ matrix.determinate && ' with determinate' || '' }} (true, map[nix-system:aarch64-darwin runner:macos-latest]) (push) Waiting to run
CI / Test: ${{ matrix.system.nix-system }} on ${{ matrix.system.runner }}${{ matrix.determinate && ' with determinate' || '' }} (true, map[nix-system:x86_64-linux runner:nscloud-ubuntu-22.04-amd64-4x16]) (push) Waiting to run
CI / Install Nix without an ID token (push) Successful in 1m6s
CI / Check the dist/ folder is up to date (push) Failing after 1m13s
CI / Install Nix using non-default source-${{ matrix.inputs.key }} (map[key:url nix-version:2.31.2 value:https://github.com/DeterminateSystems/nix-installer/releases/download/v3.11.3/nix-installer-x86_64-linux]) (push) Failing after 1m11s
Update `detsys-ts`: Merge pull request #177 from DeterminateSystems/dependabot/npm_and_yarn/fast-xml-parser-5.7.3
2026-05-11 16:36:55 -05:00
Cole Helbling b6e4494ddc Merge pull request #251 from DeterminateSystems/dependabot/npm_and_yarn/fast-xml-builder-1.2.0 2026-05-08 13:29:56 -07:00
lucperkins fcf915473a Update detsys-ts for: Merge pull request #177 from DeterminateSystems/dependabot/npm_and_yarn/fast-xml-parser-5.7.3 (bc7c106804f775f17c754b620f1dfd23add68e03) 2026-05-08 20:17:55 +00:00
lucperkins 36fb5b1a60 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.987561%2Brev-1c3fe55ad329cbcb28471bb30f05c9827f724c76/019dd544-2f5a-70b0-a89a-cf26aa85b1a7/source.tar.gz' (2026-04-27)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.992384%2Brev-549bd84d6279f9852cae6225e372cc67fb91a4c1/019df915-70b5-73a2-a5a4-63c620b45d9f/source.tar.gz' (2026-05-05)
2026-05-08 20:16:49 +00:00
Luc Perkins c2a30cb3a8 Regenerate dist 2026-05-08 15:13:10 -05:00
dependabot[bot] 3e4b225f86 Bump fast-xml-builder from 1.1.5 to 1.2.0
Bumps [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) from 1.1.5 to 1.2.0.
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-builder/compare/v1.1.5...v1.2.0)

---
updated-dependencies:
- dependency-name: fast-xml-builder
  dependency-version: 1.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-08 18:38:46 +00:00
detsys-pr-bot 4a754ab0c1 Update detsys-ts: Populate group properties (#176) (#250)
* flake.lock: Update

Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.977467%2Brev-4c1018dae018162ec878d42fec712642d214fdfa/019d75d9-1186-76c1-baa5-93baafa37a8d/source.tar.gz' (2026-04-09)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.987561%2Brev-1c3fe55ad329cbcb28471bb30f05c9827f724c76/019dd544-2f5a-70b0-a89a-cf26aa85b1a7/source.tar.gz' (2026-04-27)

* Update `detsys-ts` for: `Populate group properties (#176)` (`3d0595ccaeb93bc23f37dd8f928ad6f2c7e96533`)

---------

Co-authored-by: grahamc <grahamc@users.noreply.github.com>
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-04-29 23:17:31 +00:00
Cole Helbling 92148bb48b Merge pull request #247 from detsys-pr-bot/detsys-ts-update-726a3af42b38166248e4e67011ba04523be3a1a9 2026-04-15 10:05:38 -07:00
cole-h 27719816fa Update detsys-ts for: Merge pull request #171 from DeterminateSystems/update-deps (726a3af42b38166248e4e67011ba04523be3a1a9) 2026-04-15 15:27:00 +00:00
cole-h d8e7e8f433 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.971119%2Brev-8110df5ad7abf5d4c0f6fb0f8f978390e77f9685/019d3c72-3e5d-7d8e-a4fc-0fe67ed1554b/source.tar.gz' (2026-03-28)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.977467%2Brev-4c1018dae018162ec878d42fec712642d214fdfa/019d75d9-1186-76c1-baa5-93baafa37a8d/source.tar.gz' (2026-04-09)
2026-04-15 15:25:56 +00:00
Luc Perkins b66b36319c Merge pull request #244 from DeterminateSystems/dependabot/npm_and_yarn/vite-7.3.2
Bump vite from 7.3.1 to 7.3.2
2026-04-06 19:59:13 -03:00
dependabot[bot] 316ffaba87 Bump vite from 7.3.1 to 7.3.2
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v7.3.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.3.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-06 22:47:13 +00:00
Luc Perkins 430608d219 Merge pull request #243 from DeterminateSystems/switch-to-npm 2026-03-31 17:42:03 -03:00
Luc Perkins efb202a03d Change structure of build matrix 2026-03-31 13:23:45 -03:00
Luc Perkins db0a13c605 Remove unused runners 2026-03-31 13:21:32 -03:00
Luc Perkins b38ad18dfd Switch from pnpm to npm 2026-03-31 13:16:13 -03:00
Cole Helbling 490cfee336 Merge pull request #242 from DeterminateSystems/dependabot/npm_and_yarn/brace-expansion-1.1.13 2026-03-30 07:37:05 -07:00
Cole Helbling f329e312da fixup: ignore pnpm lock formatting... 2026-03-30 07:32:02 -07:00
dependabot[bot] a144448e6c Bump brace-expansion from 1.1.12 to 1.1.13
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.13.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.13)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-30 14:23:05 +00:00
Graham Christensen ef8a148080 Update deps, go to node24 (#239)
* Update deps

* Update to actions/checkout@v4

* Node24

* ubuntu-22.04 update
2026-03-25 14:12:51 +00:00
detsys-pr-bot e02dcf858c Update detsys-ts: Drop the old schemas and integrate the open PRs (#162) (#238)
* flake.lock: Update

Flake lock file updates:

• Updated input 'flake-schemas':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.2.1/019c8ce4-cd63-7c3c-a4cf-d1e0788fdcd9/source.tar.gz' (2026-02-12)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.4.1/019d01eb-47d3-710f-aade-0515bfcdaa1f/source.tar.gz' (2026-03-18)
• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz' (2026-02-23)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.967235%2Brev-6c9a78c09ff4d6c21d0319114873508a6ec01655/019d198c-70dc-7753-b1d1-721451f578ae/source.tar.gz' (2026-03-21)

* Update `detsys-ts` for: `Drop the old schemas and integrate the open PRs (#162)` (`24d2aa4cffcb4fe9def110e054d79beda382e6e7`)

---------

Co-authored-by: grahamc <grahamc@users.noreply.github.com>
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-03-25 00:36:30 +00:00
Graham Christensen 9a59e15a74 Attach build provenance (#236)
* Attach build provenance

* Update src/index.ts

Co-authored-by: gustavderdrache <alex.ford@determinate.systems>

---------

Co-authored-by: gustavderdrache <alex.ford@determinate.systems>
2026-03-20 09:57:34 -04:00
detsys-pr-bot d96bc962e6 Update detsys-ts for: unoptional timeout (#146) (a621ba724bb21cc2907e5252b681f9b064abc6cc) (#235)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-02-25 15:27:18 -05:00
Cole Helbling 874a9842e1 Merge pull request #233 from detsys-pr-bot/detsys-ts-update-d0fa3dbd59ce2872ddc10af1961c45538cee1bd2 2026-02-25 08:58:10 -08:00
grahamc 1ae25535ec Update detsys-ts for: Fix default value for Action option (#144) (d0fa3dbd59ce2872ddc10af1961c45538cee1bd2) 2026-02-25 15:16:15 +00:00
grahamc d9137d7b28 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-schemas':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.2.0/019a4a84-544d-7c59-b26d-e334e320c932/source.tar.gz' (2025-10-27)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.2.1/019c8ce4-cd63-7c3c-a4cf-d1e0788fdcd9/source.tar.gz' (2026-02-12)
• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.945868%2Brev-a82ccc39b39b621151d6732718e3e250109076fa/019c5b2e-592f-7d17-b9ce-868f25acfeca/source.tar.gz' (2026-02-13)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz' (2026-02-23)
2026-02-25 15:15:36 +00:00
detsys-pr-bot 95f009f8cb Update detsys-ts: Bump fast-xml-parser from 5.3.4 to 5.3.6 (#140) (#231)
* flake.lock: Update

Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.942779%2Brev-d6c71932130818840fc8fe9509cf50be8c64634f/019c3fb4-003d-710c-9b72-1d2bb1b28de3/source.tar.gz' (2026-02-08)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.945868%2Brev-a82ccc39b39b621151d6732718e3e250109076fa/019c5b2e-592f-7d17-b9ce-868f25acfeca/source.tar.gz' (2026-02-13)

* Update `detsys-ts` for: `Bump fast-xml-parser from 5.3.4 to 5.3.6 (#140)` (`f2d94964c763ad623d33d7dd59ba1474c79b8bbf`)

---------

Co-authored-by: grahamc <grahamc@users.noreply.github.com>
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-02-18 16:51:54 +00:00
detsys-pr-bot 86cbc893b3 Update detsys-ts: Bump the npm-deps group across 1 directory with 9 updates (#138) (#230)
* flake.lock: Update

Flake lock file updates:

• Updated input 'flake-schemas':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.1/018a4c59-80e1-708a-bb4d-854930c20f72/source.tar.gz' (2023-08-31)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.2.0/019a4a84-544d-7c59-b26d-e334e320c932/source.tar.gz' (2025-10-27)
• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.534224%2Brev-f99e5f03cc0aa231ab5950a15ed02afec45ed51a/018b1d3c-12f0-76a5-b796-7668d7633f08/source.tar.gz' (2023-10-09)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.942779%2Brev-d6c71932130818840fc8fe9509cf50be8c64634f/019c3fb4-003d-710c-9b72-1d2bb1b28de3/source.tar.gz' (2026-02-08)

* Update `detsys-ts` for: `Bump the npm-deps group across 1 directory with 9 updates (#138)` (`d010809b65687084386dd08928b4601be71aa4c0`)

---------

Co-authored-by: grahamc <grahamc@users.noreply.github.com>
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-02-11 17:53:12 +00:00
detsys-pr-bot 500e7f9345 Update detsys-ts for: Bump fast-xml-parser from 5.3.3 to 5.3.4 (#134) (1fd5cb877ad465a427b5510707f37dd602fab5da) (#228)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-02-11 12:16:50 -05:00
detsys-pr-bot a4f499a84c Update detsys-ts for: Bumps (#131) (ecc6f7d8f51482a078b3a0ce35f90deed874cdf0) (#223)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2026-01-28 12:24:37 -05:00
Graham Christensen c39689c63e Tidy up the macos runner list (#224)
* Tidy up the macos runner list

* Oh right we don't support intel
2026-01-28 17:19:19 +00:00
andre4ik3 58e64ed13a Add summary toggle option (#217) 2026-01-20 12:18:36 -05:00
Luc Perkins 1e3c5df315 Merge pull request #220 from detsys-pr-bot/detsys-ts-update-157fae9c23160158d80bff4260243a2f117febd4
Update `detsys-ts`: Merge pull request #126 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-939209f320
2026-01-14 13:52:05 -03:00
lucperkins 4e167d57bb Update detsys-ts for: Merge pull request #126 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-939209f320 (157fae9c23160158d80bff4260243a2f117febd4) 2026-01-14 16:45:56 +00:00
Luc Perkins ab0a9732c6 Merge pull request #210 from DeterminateSystems/lucperkins/gtm-149-nix-installer-action-readme
Provide Determinate Nix vs. upstream Nix instructions
2025-12-09 15:54:50 -03:00
detsys-pr-bot e4fb5e65d8 Update detsys-ts for: Update main and types fields in package.json (#119) (437297ec87a5c62fd90edb905eae44ab173d2aa4) (#212)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2025-12-02 02:09:17 +00:00
Luc Perkins c786b79f19 Merge pull request #211 from detsys-pr-bot/detsys-ts-update-0e3d1accf3c5dab8b18274658ede653aa016b6cd
Update `detsys-ts`: Merge pull request #116 from DeterminateSystems/dependabot/github_actions/actions-deps-76468cb07f
2025-12-01 16:53:48 -03:00
lucperkins fcca85ded7 Update detsys-ts for: Merge pull request #116 from DeterminateSystems/dependabot/github_actions/actions-deps-76468cb07f (0e3d1accf3c5dab8b18274658ede653aa016b6cd) 2025-12-01 19:36:10 +00:00
Luc Perkins 69b69b2791 Fix value in table 2025-11-17 16:33:41 -03:00
Luc Perkins 4f7e5a32d2 Provide Determinate Nix vs. upstream Nix instructions 2025-11-17 16:24:49 -03:00
Graham Christensen c5a866b6ab Update to determinate by default (#208)
* Update to determinate by default

Implements https://github.com/DeterminateSystems/nix-src/issues/201

* Fixup the version verification script
2025-11-10 09:48:50 -05:00
Graham Christensen 89b1f59ae9 Drop x86_64-darwin (#207)
* Drop x86_64-darwin

Implements https://github.com/DeterminateSystems/nix-src/issues/224

* Force back to v3.12.2 for users who don't otherwise specify a tag

* ci: don't try to render the devshell on intel macOS

* Try an error?

* Update messaging to be more action-oriented
2025-11-09 22:55:22 -05:00
Luc Perkins 86a5f59de1 Merge pull request #206 from detsys-pr-bot/detsys-ts-update-cb28f5861548d8a85d054c4d6e8e0cd3d3c94329
Update `detsys-ts`: Merge pull request #114 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-47c548f420
2025-11-07 13:02:42 -03:00
lucperkins 64a1e1d1cb Update detsys-ts for: Merge pull request #114 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-47c548f420 (cb28f5861548d8a85d054c4d6e8e0cd3d3c94329) 2025-11-07 15:52:50 +00:00
Graham Christensen 2fd3724578 If determinate is false, pass --prefer-upstream (#202)
* If determinate is false, pass --prefer-upstream

* Regenerate

* Update to an installer version that supports preferring upstream

* Delete the rev test, since rev uploads appoar to have broken a long time ago

* Fixup: expect upstream nix at the moment
2025-10-24 22:24:28 -04:00
Luc Perkins 45a18a6995 Merge pull request #203 from detsys-pr-bot/detsys-ts-update-285768c0d657f9709cb689893f12895c36923093
Update `detsys-ts`: Merge pull request #109 from DeterminateSystems/tsup-to-tsdown
2025-09-12 14:50:59 +02:00
lucperkins d3ddf0223c Update detsys-ts for: Merge pull request #109 from DeterminateSystems/tsup-to-tsdown (285768c0d657f9709cb689893f12895c36923093) 2025-09-12 12:39:38 +00:00
gustavderdrache 786fff0690 Apply fixups from CodeRabbit review (#200) 2025-09-09 10:54:24 -04:00
gustavderdrache f161ab07ed Treat FlakeHub logins as a funnel (#199) 2025-09-09 10:40:05 -04:00
gustavderdrache 61ce7897f4 Merge pull request #198 from DeterminateSystems/gustavderdrache/push-mzwwpswkrrup
Record events if authentication is skipped
2025-09-09 09:58:05 -04:00
gustavderdrache 44f3801e21 Improve messages for when auth isn't available 2025-09-09 09:48:10 -04:00
gustavderdrache cb6d4e86fa Standardize login failure events 2025-09-09 09:44:32 -04:00
gustavderdrache e686131f84 Record events if authentication is skipped 2025-09-08 16:04:19 -04:00
Graham Christensen 2c3a2981f1 Report the number of nix builds that passed / failed (#196)
* Report the number of nix builds that passed / failed

* Upgrade
2025-09-03 12:03:09 -04:00
detsys-pr-bot 18b667a294 Update detsys-ts for: Capture the version of Nix in addition to the nix store version (#108) (c7303495f43d348cac78091ef434443b1ef22485) (#197)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2025-09-03 15:37:20 +00:00
detsys-pr-bot 428f3c64a3 Update detsys-ts for: Merge pull request #106 from DeterminateSystems/fix-dependabot-warning (6d3f1c5a5781e58b3cd8060cfb578c0c95eeb51e) (#194)
Co-authored-by: lucperkins <1523104+lucperkins@users.noreply.github.com>
2025-07-30 15:59:25 +00:00
detsys-pr-bot 90bb610b90 Update detsys-ts for: Await the request promise so we can cover it with the timout handler (#105) (20c4962e328c1eba8f04da00bbb7a7e307d511e0) (#191)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2025-07-14 22:53:06 +00:00
detsys-pr-bot c723f3a885 Update detsys-ts for: Skip complicated rewrites, record groups. (#104) (0095c476e55f64d04f1aa1e1bcc2524c329d073a) (#190)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2025-07-03 09:38:17 -04:00
Luc Perkins 41e0dcf215 Merge pull request #188 from detsys-pr-bot/detsys-ts-update-5084fa8e3263a0bed2383f46e407e6c2936e8289
Update `detsys-ts`: Remove FHC action since it's composite (#103)
2025-06-24 12:56:06 -07:00
grahamc e455bc9d67 Update detsys-ts for: Remove FHC action since it's composite (#103) (5084fa8e3263a0bed2383f46e407e6c2936e8289) 2025-06-23 19:56:57 +00:00
detsys-pr-bot b336b210d0 Update detsys-ts for: Merge pull request #101 from DeterminateSystems/gustavderdrache/write-correlation (e252a66f00e041869f7e402e579141f7b8ab1edf) (#187)
Co-authored-by: gustavderdrache <194893+gustavderdrache@users.noreply.github.com>
2025-06-23 18:40:45 +00:00
Luc Perkins 999d616271 Merge pull request #184 from detsys-pr-bot/detsys-ts-update-4bf247b1cb6b057abe94721ea1bfa131618e2b7f
Update `detsys-ts`: Merge pull request #97 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-a9a1a26a5c
2025-06-02 11:59:04 -07:00
lucperkins 2a6922c6a5 Update detsys-ts for: Merge pull request #97 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-a9a1a26a5c (4bf247b1cb6b057abe94721ea1bfa131618e2b7f) 2025-06-02 18:51:49 +00:00
Luc Perkins 4a562136e6 Merge pull request #182 from DeterminateSystems/graham/fh-813-create-a-determinate-nix-action-with-pinned-releases
Add a note about pinning
2025-05-16 15:46:58 -04:00
Luc Perkins b89da14ed6 Remove unnecessary future tense 2025-05-16 15:38:25 -04:00
Luc Perkins a0000cd639 Remove redundant word 2025-05-16 15:38:09 -04:00
Luc Perkins 9793b3bc29 Fix capitalization 2025-05-16 15:37:31 -04:00
Luc Perkins 3489e2d8c3 Fix verb conjugation 2025-05-16 15:37:23 -04:00
Graham Christensen e4760a7aa0 Add a note about pinning 2025-05-16 15:28:31 -04:00
detsys-pr-bot 2f3746ebff Update detsys-ts for: Merge pull request #95 from DeterminateSystems/graham/fh-813-create-a-determinate-nix-action-with-pinned-releases (74999c82de35e73feb13af2c0e0c3ebb92a17c66) (#181)
Co-authored-by: lucperkins <1523104+lucperkins@users.noreply.github.com>
2025-05-15 21:20:56 +00:00
Graham Christensen 780ad73c03 Ditch the docker shim in favor of direct execution (#180)
Co-authored-by: gustavderdrache <alex.ford@determinate.systems>
2025-05-13 17:34:37 -04:00
Luc Perkins affd83b251 Merge pull request #178 from detsys-pr-bot/detsys-ts-update-e0a5f196fd4e17f2ba1d6ad03300fe532717f7e8
Update `detsys-ts`: Merge pull request #94 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-dde80b0a8d
2025-05-12 07:19:06 -03:00
lucperkins 7e20c99dbd Update detsys-ts for: Merge pull request #94 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-dde80b0a8d (e0a5f196fd4e17f2ba1d6ad03300fe532717f7e8) 2025-05-12 10:12:01 +00:00
Graham Christensen 88762f81a9 Fix an obscure error case where if the only log fails, the rendering is wack (#177)
* Omit extraneous "m"s

* Fix an obscure error case where if the only log fails, the rendering is wack

* Collapse seconds on the  mermaid diagram into MmSs

* Add missing possessive

* Fixup tests, rename collapseSeconds to formatDuration

---------

Co-authored-by: Luc Perkins <lucperkins@gmail.com>
2025-05-08 12:56:31 -04:00
Luc Perkins 7b9fe29d91 Merge pull request #176 from detsys-pr-bot/detsys-ts-update-87c69ec3d48cb353229e74cc2ba8abdef2eb2590f
Update `detsys-ts`: Merge pull request #93 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-a403fbca50
2025-05-04 21:47:10 -03:00
lucperkins 4795fa54eb Update detsys-ts for: Merge pull request #93 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-a403fbca50 (87c69ec3d48cb353229e74cc2ba8abdef2eb2590) 2025-05-05 00:38:20 +00:00
Luc Perkins bec3e50af8 Merge pull request #174 from detsys-pr-bot/detsys-ts-update-19c948d15e766687225515331fbebc216a14ed06
Update `detsys-ts`: Merge pull request #92 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-de653eece3
2025-04-30 15:49:45 -03:00
lucperkins 138c4e748c Update detsys-ts for: Merge pull request #92 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-de653eece3 (19c948d15e766687225515331fbebc216a14ed06) 2025-04-30 18:42:20 +00:00
gustavderdrache 7b2eab0f02 Merge pull request #173 from DeterminateSystems/hash-mismatch-summary
Add hash mismatches to summary
2025-04-24 17:33:34 -04:00
Luc Perkins 7ee09f94c3 Provide a link to our guide rather than a URL 2025-04-24 18:26:43 -03:00
gustavderdrache dfa057fae0 s/INFO/TIP/ 2025-04-24 17:12:37 -04:00
gustavderdrache a79af99b14 Add hash mismatches to summary 2025-04-24 16:47:04 -04:00
gustavderdrache 65f0526420 Merge pull request #172 from DeterminateSystems/test-penance
Test penance
2025-04-24 14:44:24 -04:00
gustavderdrache b00ad13101 Clean up unneeded brackets 2025-04-24 14:36:34 -04:00
gustavderdrache 5f843f60e2 Add test for empty build summary case 2025-04-24 14:35:39 -04:00
Luc Perkins 01d7370b1d Merge pull request #171 from DeterminateSystems/suppress-empty-summaries
Correctly suppress empty summaries
2025-04-24 15:30:04 -03:00
gustavderdrache 7c49e2a674 Correctly suppress empty summaries 2025-04-24 14:19:48 -04:00
Graham Christensen 21a544727d Sometimes, two heads are NOT as good as one. (#170) 2025-04-23 19:45:24 -04:00
gustavderdrache b669a07c99 Merge pull request #141 from JTKBowers/main
Check whether the current user has access to KVM before attempting to add udev rule
2025-04-23 18:18:46 -04:00
gustavderdrache 520fb5ebbe Merge remote-tracking branch 'upstream/main' 2025-04-23 18:04:43 -04:00
gustavderdrache 47a222377c Merge pull request #139 from dpc/dpc/jj-vqymqvyntouw
chore: detect existing `nix` installations
2025-04-23 17:59:45 -04:00
gustavderdrache c6e05d595d Merge remote-tracking branch 'upstream/main' into dpc/jj-vqymqvyntouw 2025-04-23 17:51:06 -04:00
gustavderdrache c56aa5176f Regenerate bundle 2025-04-23 17:50:58 -04:00
gustavderdrache ed5212da54 Apply suggestions from code review 2025-04-23 17:43:48 -04:00
gustavderdrache d614ddf8ca Merge pull request #169 from DeterminateSystems/flakehub-login-diagnostics
Show diagnostics for FlakeHub login issues
2025-04-23 17:41:44 -04:00
gustavderdrache e1cdf1927d Show diagnostics for FlakeHub login issues 2025-04-23 17:25:59 -04:00
Graham Christensen aacc1657a2 Don't blow the limits of summaries, by not printing logs if it blows the limit (#168)
* Don't blow the limits of summaries, by not printing logs if it blows the limit

* Print out log summaries for unrendered logs at the END of the console log, so they're easier to find

* fixup

* Pull the default max summary length out
2025-04-23 20:05:44 +00:00
Graham Christensen ce0da527df Summarize the build timeline (#165)
* Show build failure summary

* Record the start timestamp after the selftest

* Cleanup: use default parameter

* Cleanup: don't reassign arguments

* Cleanup: simplify do-while logic

* Cleanup: extract truncation helper

* Cleanup: use locals

* cleanup: minor nits

* fix lints

* build

* Use determinate-nixd's --since flag

* Re-render...

* Fixup the note about 50k being the max

---------

Co-authored-by: gustavderdrache <alex.ford@determinate.systems>
2025-04-16 13:25:51 -07:00
gustavderdrache 902d820b25 Annotate hash mismatches when Determinate features are enabled (#158)
* Render hash mismatches as feedback
* Remove superfluous punctuation
* Use determinate-nixd's hash fix feature
* Feature gate annotations
* Add annotation telemetry
* Remove .drv when rendering pretty derivation names
2025-04-14 12:40:23 -04:00
Luc Perkins 17a3ce76e0 Merge pull request #164 from detsys-pr-bot/detsys-ts-update-f42f6003b4044fede4681778f76342e523671e8f
Update `detsys-ts`: Merge pull request #89 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0b8d2803d6
2025-04-13 23:46:29 -03:00
lucperkins 52cdd33747 Update detsys-ts for: Merge pull request #89 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0b8d2803d6 (f42f6003b4044fede4681778f76342e523671e8f) 2025-04-14 02:30:08 +00:00
Luc Perkins 0d28deea2b Merge pull request #162 from detsys-pr-bot/detsys-ts-update-e31aa55518cae49b58723c152c6d0e46ee223ec1
Update `detsys-ts`: Merge pull request #87 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-2f3c1638ee
2025-04-06 22:43:26 -03:00
lucperkins 956acc53ac Update detsys-ts for: Merge pull request #87 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-2f3c1638ee (e31aa55518cae49b58723c152c6d0e46ee223ec1) 2025-04-07 01:17:10 +00:00
detsys-pr-bot 741b61d2a0 Update detsys-ts for: Merge pull request #86 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-2bd33993d4 (dc7c6d9c7a5d2db79ddc6eccf57d5fc09a391347) (#161)
Co-authored-by: lucperkins <1523104+lucperkins@users.noreply.github.com>
2025-04-04 16:26:22 +00:00
detsys-pr-bot 7239c695c3 Update detsys-ts for: Bump vite from 6.2.3 to 6.2.4 in the npm_and_yarn group (#85) (79634332de50a2cde17cf8d6fe41258af3d4bedf) (#160)
Co-authored-by: grahamc <76716+grahamc@users.noreply.github.com>
2025-03-31 19:48:26 +00:00
detsys-pr-bot 28aa4ed62f Update detsys-ts for: Merge pull request #84 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-73588cc3c5 (3ef4baee587df9fe98f70036386e361fa0d6dc7e) (#159)
Co-authored-by: lucperkins <1523104+lucperkins@users.noreply.github.com>
2025-03-31 09:05:09 -04:00
Jamie Bowers 5e80a7bd8b Check whether the current user already has access to KVM before attempting to add a udev rule. 2025-02-20 11:09:13 +00:00
Dawid Ciężarkiewicz 2d9ffd87e4 chore: add a note about how to install everything
JS has a new shiny tool every 6 months, and I'm not a JS dev, so
it's not immediately obvious why `npm run all` doesn't work, despite
being in a dev shell.
2025-02-07 15:21:18 -08:00
Dawid Ciężarkiewicz 4b27401a78 chore: detect existing nix installations 2025-02-07 15:19:55 -08:00
31 changed files with 100306 additions and 77448 deletions
+1 -2
View File
@@ -7,9 +7,8 @@ EXPECTED_VERSION="${1}"
INSTALLED_NIX_VERSION_OUTPUT=$(nix --version)
INSTALLED_NIX_VERSION=$(echo "${INSTALLED_NIX_VERSION_OUTPUT}" | awk '{print $NF}')
EXPECTED_OUTPUT="nix (Nix) ${EXPECTED_VERSION}"
if [ "${INSTALLED_NIX_VERSION_OUTPUT}" != "${EXPECTED_OUTPUT}" ]; then
if [ "${INSTALLED_NIX_VERSION}" != "${EXPECTED_VERSION}" ]; then
echo "Nix version ${INSTALLED_NIX_VERSION} didn't match expected version ${EXPECTED_VERSION}"
exit 1
else
+26 -32
View File
@@ -8,7 +8,7 @@ on:
jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs:
- check-dist-up-to-date
- install-nix
@@ -24,48 +24,46 @@ jobs:
check-dist-up-to-date:
name: Check the dist/ folder is up to date
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- name: pnpm install
run: nix develop --command pnpm install
- name: npm install
run: nix develop --command npm ci
- name: prettier format
run: nix develop --command pnpm run check-fmt
run: nix develop --command npm run check-fmt
- name: ESLint
run: nix develop --command pnpm run lint
run: nix develop --command npm run lint
- name: tsup build
run: nix develop --command pnpm run build
run: nix develop --command npm run build
- name: ncc package
run: nix develop --command pnpm run package
run: nix develop --command npm run package
- name: Git status
run: git status --porcelain=v1
- name: Ensure no staged changes
run: git diff --exit-code
install-nix:
name: "Test: ${{ matrix.runner }}${{ matrix.determinate && ' with determinate' || '' }}"
name: "Test: ${{ matrix.system.nix-system }} on ${{ matrix.system.runner }}${{ matrix.determinate && ' with determinate' || '' }}"
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- nscloud-ubuntu-22.04-amd64-4x16
- namespace-profile-default-arm64
# - macos-12-large # determinate-nixd is broken on macos-12
- macos-13-large
- macos-14-large
- macos-14-xlarge # arm64
system:
- {
nix-system: x86_64-linux,
runner: nscloud-ubuntu-22.04-amd64-4x16,
}
- { nix-system: aarch64-darwin, runner: macos-latest }
determinate:
- true
- false
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.system.runner }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install Nix
uses: ./
with:
@@ -78,7 +76,7 @@ jobs:
run: echo $PATH
- name: Render the devshell
if: success() || failure()
if: (success() || failure())
run: |
nix develop --command date
@@ -146,21 +144,17 @@ jobs:
install-with-non-default-source-inputs:
name: Install Nix using non-default source-${{ matrix.inputs.key }}
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
inputs:
# https://github.com/DeterminateSystems/nix-installer/blob/v0.18.0
# https://github.com/DeterminateSystems/nix-installer/blob/v3.11.3
- key: url
value: https://github.com/DeterminateSystems/nix-installer/releases/download/v0.18.0/nix-installer-x86_64-linux
nix-version: "2.21.2"
# https://github.com/DeterminateSystems/nix-installer/tree/7011c077ec491da410fbc39f68676b0908b9ce7e
- key: revision
value: 7011c077ec491da410fbc39f68676b0908b9ce7e
nix-version: "2.19.2"
value: https://github.com/DeterminateSystems/nix-installer/releases/download/v3.11.3/nix-installer-x86_64-linux
nix-version: "2.31.2" # 3.11.3 is based on 2.31.2
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install with alternative source-${{ matrix.inputs.key }}
uses: ./
with:
@@ -171,9 +165,9 @@ jobs:
install-no-id-token:
name: Install Nix without an ID token
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./
with:
_internal-strict-mode: true
+4 -1
View File
@@ -1,3 +1,6 @@
.direnv/
dist/
lib/
node_modules/
node_modules/
package-lock.json
+2
View File
@@ -1,3 +1,5 @@
# Submitting Pull Requests
Run `npm ci` to install necessary JS tools.
This action is based off https://github.com/actions/javascript-action. As part of your contributing flow you **must** run `npm run all` before we can merge.
+49 -15
View File
@@ -1,14 +1,14 @@
# The Determinate Nix Installer Action
Based on the [Determinate Nix Installer](https://github.com/DeterminateSystems/nix-installer), responsible for over tens of thousands of Nix installs daily.
The fast, friendly, and reliable GitHub Action to install Nix with Flakes.
The fast, friendly, and reliable GitHub Action to install [Determinate Nix][det-nix] with [flakes].
The Determinate Nix Installer Action is based on [Determinate Nix Installer][installer], which is responsible for tens of thousands of installs daily.
## Supports
-**Accelerated KVM** on open source projects and larger runners. See [GitHub's announcement](https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/) for more info.
- ✅ Linux, x86_64, aarch64, and i686
- ✅ macOS, x86_64 and aarch64
- ✅ WSL2, x86_64 and aarch64
- ✅ Linux (x86_64 and aarch64)
- ✅ macOS (aarch64)
- ✅ Windows Subsystem for Linux (WSL) (x86_64 and aarch64)
- ✅ Containers
- ✅ Valve's SteamOS
- ✅ GitHub Enterprise Server
@@ -27,14 +27,18 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- run: nix build .
```
> [!NOTE]
> This Action installs [Determinate Nix][det-nix] by default.
> You can, however, use it to install [upstream Nix](#installing-upstream-nix) until **January 1, 2026**.
### With FlakeHub
To fetch private flakes from FlakeHub and Nix builds from FlakeHub Cache, update the `permissions` block and pass `determinate: true`:
To fetch private flakes from FlakeHub and Nix builds from FlakeHub Cache, update the `permissions` block and use [`determinate-nix-action`][determinate-nix-action] instead of this Action:
```yaml
on:
@@ -50,15 +54,26 @@ jobs:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@v3
- run: nix build .
```
See [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for a full example.
### Pinning the version
This GitHub Action uses the most recent version of Determinate Nix Installer, even when the Action itself is pinned.
If you wish to pin your CI workflows to a specific Determinate Nix version, use the [`determinate-nix-action`][determinate-nix-action].
That Action is updated and tagged for every Determinate release.
The `DeterminateSystems/determinate-nix-action@v3.5.2` reference, for example, always installs Determinate Nix v3.5.2.
Additionally, an extra tag on the major version is kept up to date with the current release.
The `DeterminateSystems/determinate-nix-action@v3` reference, for example, installs the most recent release in the `v3.x.y` series.
If you do tag to a specific version, please [use Dependabot to update your actions][dependabot-actions].
### Advanced Usage
- If KVM is available, the installer sets up KVM so that Nix can use it ,and exports the `DETERMINATE_NIX_KVM` environment variable set to 1.
@@ -73,8 +88,8 @@ Differing from the upstream [Nix](https://github.com/NixOS/nix) installer script
- the `nix-command` and `flakes` features are enabled
- `bash-prompt-prefix` is set
- `auto-optimise-store` is set to `true` (On Linux only)
* `extra-nix-path` is set to `nixpkgs=flake:nixpkgs`
* `max-jobs` is set to `auto`
- `extra-nix-path` is set to `nixpkgs=flake:nixpkgs`
- `max-jobs` is set to `auto`
- KVM is enabled by default.
- an installation receipt (for uninstalling) is stored at `/nix/receipt.json` as well as a copy of the install binary at `/nix/nix-installer`
- `nix-channel --update` is not run, `~/.nix-channels` is not provisioned
@@ -85,11 +100,11 @@ Differing from the upstream [Nix](https://github.com/NixOS/nix) installer script
| Parameter | Description | Type | Default |
| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- | :------------------------------------------------------------- |
| `backtrace` | The setting for [`RUST_BACKTRACE`][backtrace] | string | |
| `determinate` | Whether to install [Determinate Nix](https://determinate.systems/enterprise) and log in to FlakeHub for private Flakes and binary caches. | Boolean | `false` |
| `determinate` | Whether to install [Determinate Nix](https://determinate.systems/enterprise) and log in to FlakeHub for private Flakes and binary caches. | Boolean | `true` |
| `extra-args` | Extra arguments to pass to the planner (prefer using structured `with:` arguments unless using a custom [planner]!) | string | |
| `extra-conf` | Extra configuration lines for `/etc/nix/nix.conf` (includes `access-tokens` with `secrets.GITHUB_TOKEN` automatically if `github-token` is set) | string | |
| `flakehub` | Deprecated. Implies `determinate`. | Boolean | `false` |
| `force-docker-shim` | Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary. | Boolean | `false` |
| `force-no-systemd` | Force using other methods than systemd to launch the daemon. This setting is automatically enabled when necessary. | Boolean | `false` |
| `github-token` | A [GitHub token] for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests) | string | `${{ github.token }}` |
| `github-server-url` | The URL for the GitHub server, to use with the `github-token` token. Defaults to the current GitHub server, supporting GitHub Enterprise Server automatically. Only change this value if the provided `github-token` is for a different GitHub server than the current server. | string | `${{ github.server }}` |
| `init` | The init system to configure (requires `planner: linux-multi`) | enum (`none` or `systemd`) | |
@@ -117,13 +132,32 @@ Differing from the upstream [Nix](https://github.com/NixOS/nix) installer script
| `reinstall` | Force a reinstall if an existing installation is detected (consider backing up `/nix/store`) | Boolean | `false` |
| `start-daemon` | If the daemon should be started, requires `planner: linux-multi` | Boolean | `false` |
| `trust-runner-user` | Whether to make the runner user trusted by the Nix daemon | Boolean | `true` |
| `summarize` | Whether to add a build summary and timeline chart to the GitHub job summary | Boolean | `true` |
| `diagnostic-endpoint` | Diagnostic endpoint url where the installer sends install [diagnostic reports](https://github.com/DeterminateSystems/nix-installer#diagnostics) to, to disable set this to an empty string | string | `https://install.determinate.systems/nix-installer/diagnostic` |
| `proxy` | The proxy to use (if any), valid proxy bases are `https://$URL`, `http://$URL` and `socks5://$URL` | string | |
| `ssl-cert-file` | An SSL cert to use (if any), used for fetching Nix and sets `NIX_SSL_CERT_FILE` for Nix | string | |
## Installing upstream Nix
Although Determinate Nix is the default, you can also use this Action to install [upstream Nix][upstream].
Make sure to set `determinate: false` in the Action's configuration:
```yaml
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: false
```
This option will be available until **January 1, 2026**, at which point installing upstream Nix using this Action will no longer be possible.
[apfs]: https://en.wikipedia.org/wiki/Apple_File_System
[backtrace]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables
[dependabot-actions]: https://github.com/DeterminateSystems/determinate-nix-action?tab=readme-ov-file#-automate-updates-with-dependabot
[det-nix]: https://docs.determinate.systems/determinate-nix
[determinate-nix-action]: https://github.com/DeterminateSystems/determinate-nix-action
[github token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
[installer]: https://github.com/DeterminateSystems/nix-installer
[planner]: https://github.com/determinateSystems/nix-installer#usage
[profile]: https://nixos.org/manual/nix/stable/package-management/profiles
[tracing directives]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
[upstream]: https://github.com/NixOS/nix
+7 -4
View File
@@ -10,7 +10,7 @@ inputs:
determinate:
description: |
Whether to install [Determinate Nix](https://determinate.systems/enterprise) and log in to FlakeHub for private Flakes and binary caches.
default: false
default: true
extra-args:
description: Extra args to pass to the planner (prefer using structured `with:` arguments unless using a custom planner!)
required: false
@@ -21,8 +21,8 @@ inputs:
description: Deprecated. Implies `determinate`.
required: false
default: false
force-docker-shim:
description: Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary.
force-no-systemd:
description: Force using other methods than systemd to launch the daemon. This setting is automatically enabled when necessary.
required: false
default: false
github-token:
@@ -126,6 +126,9 @@ inputs:
trust-runner-user:
description: Whether to make the runner user trusted by the Nix daemon
default: true
summarize:
description: Whether to add a build summary and timeline chart to the GitHub job summary
default: true
nix-installer-branch:
description: (deprecated) The branch of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-revision`, `nix-installer-pr`)
required: false
@@ -147,6 +150,6 @@ inputs:
default: false
runs:
using: "node20"
using: "node24"
main: "dist/index.js"
post: "dist/index.js"
Generated Vendored
BIN
View File
Binary file not shown.
Generated Vendored
BIN
View File
Binary file not shown.
Generated Vendored
+90712 -71007
View File
File diff suppressed because one or more lines are too long
-19
View File
@@ -1,19 +0,0 @@
# Determinate Nix Installer: Docker Shim
#
# This empty image exists to lean on Docker as a process supervisor when
# systemd isn't available. Specifically intended for self-hosted GitHub
# Actions runners using Docker-in-Docker.
#
# See: https://github.com/DeterminateSystems/nix-installer-action
FROM scratch
ENTRYPOINT [ "/nix/var/nix/profiles/default/bin/nix-daemon"]
CMD []
HEALTHCHECK \
--interval=5m \
--timeout=3s \
CMD ["/nix/var/nix/profiles/default/bin/nix", "store", "ping", "--store", "daemon"]
COPY ./Dockerfile /README.md
-52
View File
@@ -1,52 +0,0 @@
# Determinate Nix Installer Action: Docker Shim
The image in this repository is a product of the contained Dockerfile.
It is an otherwise empty image with a configuration layer.
This image is to be used in GitHub Actions runners which don't have systemd available, like self-hosted ARC runners.
The image would have no layers / content at all, however Docker has a bug and refuses to export those images.
This isn't a technical limitation preventing us from creating and distributing that image, but an ease-of-use limitation.
Since some of Docker's inspection tools break on an empty image, the image contains a single layer containing a README.
To build:
```shell
docker build . --tag determinate-nix-shim:latest
docker image save determinate-nix-shim:latest | gzip --best > amd64.tar
```
Then, extract the tarball:
```
mkdir extract
cd extract
tar -xf ../amd64.tar
```
It'll look like this, though the hashes will be different.
```
.
├── 771204abb853cdde06bbbc680001a02642050a1db1a7b0a48cf5f20efa8bdc5d.json
├── c4088111818e553e834adfc81bda8fe6da281afa9a40012eaa82796fb5476e98
│   ├── VERSION
│   ├── json
│   └── layer.tar
├── manifest.json
└── repositories
```
Ignore `manifest.json`, and edit the other two JSON documents to replace `amd64` with `arm64`, both in a key named "architecture:
```
"architecture":"amd64"
```
Then re-create the tar, from within the `extract` directory:
```
tar --options gzip:compression-level=9 -zcf ../arm64.tar.gz .
```
Then `git add` the two .tar.gz's and you're done.
Binary file not shown.
Binary file not shown.
Generated
+6 -21
View File
@@ -1,36 +1,21 @@
{
"nodes": {
"flake-schemas": {
"locked": {
"lastModified": 1693491534,
"narHash": "sha256-ifw8Td8kD08J8DxFbYjeIx5naHcDLz7s2IFP3X42I/U=",
"rev": "c702cbb663d6d70bbb716584a2ee3aeb35017279",
"revCount": 21,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.1/018a4c59-80e1-708a-bb4d-854930c20f72/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A.tar.gz"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696879762,
"narHash": "sha256-Ud6bH4DMcYHUDKavNMxAhcIpDGgHMyL/yaDEAVSImQY=",
"rev": "f99e5f03cc0aa231ab5950a15ed02afec45ed51a",
"revCount": 534224,
"lastModified": 1777954456,
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
"revCount": 992384,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.534224%2Brev-f99e5f03cc0aa231ab5950a15ed02afec45ed51a/018b1d3c-12f0-76a5-b796-7668d7633f08/source.tar.gz"
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.992384%2Brev-549bd84d6279f9852cae6225e372cc67fb91a4c1/019df915-70b5-73a2-a5a4-63c620b45d9f/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz"
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
}
},
"root": {
"inputs": {
"flake-schemas": "flake-schemas",
"nixpkgs": "nixpkgs"
}
}
+34 -20
View File
@@ -2,30 +2,44 @@
{
description = "Development environment for the Nix Installer action for GitHub.";
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
};
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs = { self, flake-schemas, nixpkgs }:
outputs =
{ self, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "aarch64-linux" "x86_64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
supportedSystems = [
"x86_64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs { inherit system; };
}
);
in
{
schemas = flake-schemas.schemas;
devShells = forEachSupportedSystem (
{ pkgs, system }:
{
default = pkgs.mkShell {
packages = with pkgs; [
nodejs_latest
self.formatter.${system}
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs_latest
nixpkgs-fmt
nodePackages_latest.pnpm
nodePackages_latest.typescript-language-server
];
};
});
# Keep people from accidentally running pnpm
(writeScriptBin "pnpm" ''
echo "pnpm is no longer used in this repo; use npm instead"
exit 1
'')
];
};
}
);
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt);
};
}
+8097
View File
File diff suppressed because it is too large Load Diff
+16 -14
View File
@@ -11,7 +11,8 @@
"check-fmt": "prettier --check .",
"lint": "eslint src/**/*.ts",
"package": "ncc build",
"all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package"
"test": "vitest --watch false",
"all": "npm run test && npm run format && npm run lint && npm run build && npm run package"
},
"repository": {
"type": "git",
@@ -25,26 +26,27 @@
},
"homepage": "https://github.com/DeterminateSystems/nix-installer-action#readme",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/github": "^9.0.0",
"detsys-ts": "github:DeterminateSystems/detsys-ts",
"got": "^14.4.6",
"string-argv": "^0.3.2"
"got": "^14.6.6",
"string-argv": "^0.3.2",
"vitest": "^3.2.4"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.17.28",
"@types/node": "^20.19.37",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@vercel/ncc": "^0.38.3",
"@vercel/ncc": "^0.38.4",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.10.0",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.5",
"prettier": "^3.5.3",
"tsup": "^8.4.0",
"typescript": "^5.8.2"
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.5",
"prettier": "^3.8.1",
"tsup": "^8.5.1",
"typescript": "^5.9.3"
}
}
-5848
View File
File diff suppressed because it is too large Load Diff
+66
View File
@@ -0,0 +1,66 @@
import * as core from "@actions/core";
import type { Fix, FixHashesOutputV1, Mismatch } from "./fixHashes.js";
function prettyDerivation(derivation: string): string {
return derivation.replace(/\/nix\/store\/\w+-/, "").replace(/.drv$/, "");
}
function annotateSingle(
file: string,
line: number,
{ derivation, replacement }: Mismatch,
): void {
const pretty = prettyDerivation(derivation);
core.error(`To correct the hash mismatch for ${pretty}, use ${replacement}`, {
file,
startLine: line,
});
}
function annotateMultiple(
file: string,
{ line, found, mismatches }: Fix,
): void {
const matches = mismatches
.map(({ derivation, replacement }) => {
const pretty = prettyDerivation(derivation);
return `* For the derivation ${pretty}, use ${replacement}`;
})
.join("\n");
core.error(
`There are multiple replacements for the expression ${found}:\n${matches}`,
{
file,
startLine: line,
},
);
}
function annotate(file: string, fix: Fix): void {
if (fix.mismatches.length === 1) {
annotateSingle(file, fix.line, fix.mismatches[0]);
} else {
annotateMultiple(file, fix);
}
}
/**
* Annotates fixed-output derivation hash mismatches using GitHub Actions'
*
* @param output The output of `determinate-nixd fix hashes --json`
* @returns The number of annotations reported to the user
*/
export function annotateMismatches(output: FixHashesOutputV1): number {
let count = 0;
for (const { file, fixes } of output.files) {
for (const fix of fixes) {
annotate(file, fix);
count++;
}
}
return count;
}
+65
View File
@@ -0,0 +1,65 @@
import { parseEvents, getRecentEvents } from "./events.js";
import { expect, test } from "vitest";
// Handy test for locally making sure you can fetch recent events:
// eslint-disable-next-line no-constant-condition
if (false) {
test("Parsing existing events", async () => {
expect(await getRecentEvents(new Date(Date.now() - 1000000))).toStrictEqual(
[{}],
);
});
}
test("Parsing existing events", () => {
const { events } = parseEvents([
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/m96zgji4fhi70s2zs6pq5pric6ch7p4h-stdenv-darwin.drv",
outputs: ["/nix/store/dalhfz3l75w4b4q06sxzqgb2wfydvkbv-stdenv-darwin"],
timing: null,
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv",
outputs: ["/nix/store/qwlgz5da3pfb53gqpgdmazaj9jczrnly-dep-1"],
timing: {
startTime: "2025-04-11T14:38:02Z",
stopTime: "2025-04-11T14:38:05Z",
durationSeconds: 3,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: "/nix/store/ykvbksjqrza2zpj6nkbycrdfwgfdpr8g-hash-mismatch-md5-base16.drv",
timing: {
startTime: "2025-04-11T14:36:44Z",
stopTime: "2025-04-11T14:36:44Z",
durationSeconds: 0,
},
},
]);
expect(events).toStrictEqual([
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv",
timing: {
durationSeconds: 3,
startTime: new Date("2025-04-11T14:38:02Z"),
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: "/nix/store/ykvbksjqrza2zpj6nkbycrdfwgfdpr8g-hash-mismatch-md5-base16.drv",
timing: {
durationSeconds: 0,
startTime: new Date("2025-04-11T14:36:44Z"),
},
},
]);
});
+89
View File
@@ -0,0 +1,89 @@
import got from "got";
export interface DEvent {
v: string;
c: string;
drv: string;
timing: {
startTime: Date;
durationSeconds: number;
};
}
export interface ParsedEventsResult {
readonly events: DEvent[];
readonly hasMismatches: boolean;
}
export function parseEvents(data: unknown): ParsedEventsResult {
let hasMismatches = false;
if (!Array.isArray(data)) {
return { events: [], hasMismatches };
}
const events = data.flatMap((event) => {
// If this was a hash mismatch event, note it and move on
if (event.v === "1" && event.c === "HashMismatchResponseEventV1") {
hasMismatches = true;
return [];
}
// Otherwise, determine if it's an event we're interested in
if (
event.v === "1" &&
(event.c === "BuildFailureResponseEventV1" ||
event.c === "BuiltPathResponseEventV1") &&
Object.hasOwn(event, "drv") &&
typeof event.drv === "string" &&
Object.hasOwn(event, "timing") &&
typeof event.timing === "object" &&
event.timing !== null
) {
const timing = event.timing as { [key: string]: unknown };
if (
Object.hasOwn(timing, "startTime") &&
typeof timing.startTime === "string" &&
Object.hasOwn(timing, "durationSeconds") &&
typeof timing.durationSeconds === "number"
) {
const date = Date.parse(timing.startTime);
if (!Number.isNaN(date)) {
return [
{
v: event.v,
c: event.c,
drv: event.drv,
timing: {
startTime: new Date(date),
durationSeconds: timing.durationSeconds,
},
},
];
}
}
}
return [];
});
return { events, hasMismatches };
}
export async function getRecentEvents(
since: Date,
): Promise<ParsedEventsResult> {
const queryParam = encodeURIComponent(since.toISOString());
const resp = await got
.get(
`http://unix:/nix/var/determinate/determinate-nixd.socket:/events/recent?since=${queryParam}`,
{
enableUnixSockets: true,
},
)
.json();
return parseEvents(resp);
}
+275
View File
@@ -0,0 +1,275 @@
import { expect, test } from "vitest";
import {
FailureSummary,
getBuildFailures,
summarizeFailures,
} from "./failuresummary.js";
/* eslint-disable @typescript-eslint/no-non-null-assertion */
test("Select for failure events", () => {
const events = [
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv`,
timing: {
startTime: new Date(1 * 1000),
durationSeconds: 1,
},
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-2.drv`,
timing: {
startTime: new Date(2 * 1000),
durationSeconds: 2,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv`,
timing: {
startTime: new Date(3 * 1000),
durationSeconds: 3,
},
},
];
expect(getBuildFailures(events)).toStrictEqual([
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv`,
timing: {
startTime: new Date(1 * 1000),
durationSeconds: 1,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv`,
timing: {
startTime: new Date(3 * 1000),
durationSeconds: 3,
},
},
]);
});
test("Summarize Failures", async () => {
const events = [
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv`,
timing: {
startTime: new Date(1 * 1000),
durationSeconds: 1,
},
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-2.drv`,
timing: {
startTime: new Date(2 * 1000),
durationSeconds: 2,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv`,
timing: {
startTime: new Date(3 * 1000),
durationSeconds: 3,
},
},
];
const logMaker = async (drv: string): Promise<string | undefined> => {
if (drv.includes("dep-1")) {
return `${drv}\n`.repeat(9).trimEnd();
} else {
return `${drv}\n`.repeat(25).trimEnd();
}
};
const summary: FailureSummary = (await summarizeFailures(events, logMaker))!;
expect(summary.markdownLines.join("\n"))
.toStrictEqual(`### Build error review :boom:
> [!NOTE]
> 2 builds failed
<details><summary>Failure log: <code>/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-<strong>dep-1</strong>.drv</code></summary>
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
</details>
<details><summary>Failure log: <code>/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-<strong>dep-3</strong>.drv</code></summary>
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
</details>
`);
expect(summary.logLines.join("\n"))
.toStrictEqual(`\u001b[38;2;255;0;0mBuild logs from 2 failures
The following build logs are also available in the Markdown summary:
::group::Failed build: /nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
::endgroup::
::group::Failed build: /nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
::endgroup::`);
});
test("Omit some logs if there are too many", async () => {
const events = [
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv`,
timing: {
startTime: new Date(1 * 1000),
durationSeconds: 1,
},
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-2.drv`,
timing: {
startTime: new Date(2 * 1000),
durationSeconds: 2,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv`,
timing: {
startTime: new Date(3 * 1000),
durationSeconds: 3,
},
},
];
const logMaker = async (drv: string): Promise<string | undefined> => {
return `${drv}\n`.repeat(5).trimEnd();
};
const summary: FailureSummary = (await summarizeFailures(
events,
logMaker,
500,
))!;
expect(summary.markdownLines.join("\n"))
.toStrictEqual(`### Build error review :boom:
> [!NOTE]
> 2 builds failed
<details><summary>Failure log: <code>/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-<strong>dep-1</strong>.drv</code></summary>
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
</details>
> [!NOTE]
> The following failure has been omitted due to GitHub Actions' summary length limitations.
> The full logs are available in the post-run phase of the Nix Installer Action.
> * \`/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv\``);
expect(summary.logLines.join("\n"))
.toStrictEqual(`\u001b[38;2;255;0;0mBuild logs from 2 failures
The following build logs are also available in the Markdown summary:
::group::Failed build: /nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv
::endgroup::
The following build logs are NOT available in the Markdown summary:
::group::Failed build: /nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-3.drv
::endgroup::`);
});
+124
View File
@@ -0,0 +1,124 @@
import { getExecOutput } from "@actions/exec";
import { DEvent } from "./events.js";
import { stripVTControlCharacters } from "node:util";
// CI summaries have a max length of "1024k" which I assume to be 1048576 bytes.
// Generously, the mermaid doc is about 50,000 bytes.
// Rounding it all down a bit further for wiggle room, that leaves lots of log space.
const defaultMaxSummaryLength = 995_000;
export function getBuildFailures(events: DEvent[]): DEvent[] {
return events.filter((event: DEvent): Boolean => {
return event.c === "BuildFailureResponseEventV1";
});
}
export interface FailureSummary {
logLines: string[];
markdownLines: string[];
}
export async function summarizeFailures(
events: DEvent[],
getLog: (drv: string) => Promise<string | undefined> = getLogFromNix,
maxLength: number = defaultMaxSummaryLength,
): Promise<FailureSummary | undefined> {
const failures = getBuildFailures(events);
if (failures.length === 0) {
return undefined;
}
const logLines = [];
const markdownLines = [];
logLines.push(
`\u001b[38;2;255;0;0mBuild logs from ${failures.length} failure${failures.length === 1 ? "" : "s"}`,
);
logLines.push(
`The following build logs are also available in the Markdown summary:`,
);
markdownLines.push(`### Build error review :boom:`);
markdownLines.push("> [!NOTE]");
markdownLines.push(
`> ${failures.length} build${failures.length === 1 ? "" : "s"} failed`,
);
const markdownLogChunks: {
drv: string;
txtLines: string[];
mdLines: string[];
}[] = [];
for (const event of failures) {
const markdownLogChunk = [];
const txtLogChunk = [];
txtLogChunk.push(`::group::Failed build: ${event.drv}`);
const log =
(await getLog(event.drv)) ??
"(failure reading the log for this derivation.)";
const indented = log.split("\n").map((line) => ` ${line}`);
markdownLogChunk.push(
`<details><summary>Failure log: <code>${event.drv.replace(/^(\/nix[^-]*-)(.*)(\.drv)$/, "$1<strong>$2</strong>$3")}</code></summary>`,
);
markdownLogChunk.push("");
for (const line of indented) {
txtLogChunk.push(line);
markdownLogChunk.push(stripVTControlCharacters(line));
}
markdownLogChunk.push("");
markdownLogChunk.push("</details>");
markdownLogChunk.push("");
markdownLogChunks.push({
drv: event.drv,
mdLines: markdownLogChunk,
txtLines: txtLogChunk,
});
txtLogChunk.push(`::endgroup::`);
}
const skippedChunks = [];
// Add markdown log chunks until we exceed the max length
let markdownLength = markdownLines.join("\n").length;
for (const chunk of markdownLogChunks) {
const chunkLength = chunk.mdLines.join("\n").length;
if (markdownLength + chunkLength > maxLength) {
skippedChunks.push(chunk);
} else {
logLines.push(...chunk.txtLines);
markdownLines.push(...chunk.mdLines);
markdownLength += chunkLength;
}
}
if (skippedChunks.length > 0) {
markdownLines.push(
"",
"> [!NOTE]",
`> The following ${skippedChunks.length === 1 ? "failure has" : "failures have"} been omitted due to GitHub Actions' summary length limitations.`,
"> The full logs are available in the post-run phase of the Nix Installer Action.",
);
logLines.push(
"The following build logs are NOT available in the Markdown summary:",
);
for (const chunk of skippedChunks) {
markdownLines.push(`> * \`${chunk.drv}\``);
logLines.push(...chunk.txtLines);
}
}
return { logLines, markdownLines };
}
async function getLogFromNix(drv: string): Promise<string | undefined> {
const output = await getExecOutput("nix", ["log", drv], {
silent: true,
});
return output.stdout;
}
+38
View File
@@ -0,0 +1,38 @@
import { getExecOutput } from "@actions/exec";
export interface Mismatch {
readonly derivation: string;
readonly replacement: string;
}
export interface Fix {
readonly line: number;
readonly found: string;
readonly mismatches: readonly Mismatch[];
}
export interface FileFix {
readonly file: string;
readonly fixes: readonly Fix[];
}
export interface FixHashesOutputV1 {
readonly version: "v1";
readonly files: readonly FileFix[];
}
export async function getFixHashes(since: string): Promise<FixHashesOutputV1> {
const output = await getExecOutput(
"determinate-nixd",
["fix", "hashes", "--json", "--since", since],
{ silent: true },
);
if (output.exitCode !== 0) {
throw new Error(
`determinate-nixd fix hashes returned non-zero exit code ${output.exitCode} with the following error output:\n${output.stderr}`,
);
}
return JSON.parse(output.stdout);
}
+381 -410
View File
File diff suppressed because it is too large Load Diff
+207
View File
@@ -0,0 +1,207 @@
import { mermaidify, makeMermaidReport } from "./mermaid.js";
import { DEvent, parseEvents } from "./events.js";
import { expect, test } from "vitest";
/* eslint-disable @typescript-eslint/no-non-null-assertion */
function generateEvents(count: number): DEvent[] {
const events: DEvent[] = [];
for (let i = 0; i < count; i++) {
events.push({
v: "1",
c: "BuiltPathResponseEventV1",
drv: `/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-${i}.drv`,
timing: {
startTime: new Date(i * 1000),
durationSeconds: i,
},
});
}
return events;
}
test("Empty event list returns no report", () => {
const report = makeMermaidReport([]);
expect(report).toBeUndefined();
});
test("Create a very large report doc and make sure it is small enough", () => {
const report = makeMermaidReport(generateEvents(2500))!;
// Assert the `.drv` suffix was pruned (1 reference = the NOTE at the end)
expect(report.match(/\.drv/g)!.length).equals(1);
// Assert the `/nix/store` prefix was pruned (1 reference = the NOTE at the end)
expect(report.match(/\/nix\/store\//g)!.length).equals(1);
// Assert that some events were pruned
expect(report.match(/dep-/g)!.length).lessThan(2500);
expect(report.match(/dep-/g)!.length).greaterThan(1500);
expect(report).toContain("suffix, and builds that took less than ");
expect(report.length).lessThan(50200);
expect(report.length).greaterThan(49000);
});
test("Create a medium large report doc and make sure it is small enough", () => {
const eventCount = 675;
const report = makeMermaidReport(generateEvents(eventCount))!;
// Assert the `.drv` suffix was pruned (1 reference = the NOTE at the end)
expect(report.match(/\.drv/g)!.length).equals(1);
// Assert the `/nix/store` prefix was pruned (1 reference = the NOTE at the end)
expect(report.match(/\/nix\/store\//g)!.length).equals(1);
// Assert that no lines were pruned
expect(report.match(/dep-/g)!.length).toStrictEqual(eventCount);
expect(report).toContain(
"suffixes have been removed to make the graph small enough to render",
);
expect(report.length).lessThan(50200);
expect(report.length).greaterThan(18000);
});
test("Create a small report doc and make sure it isn't pruned", () => {
const report = makeMermaidReport(generateEvents(100))!;
// Assert 100 events have the `.drv` suffix, ie: were not pruned
expect(report.match(/\.drv/g)!.length).equals(100);
// Assert 100 events have the `.drv` suffix, ie: were not pruned
expect(report.match(/\/nix\/store\//g)!.length).equals(100);
expect(report.length).lessThan(50000);
});
test("Generate a really big report and shrink it", () => {
const events = generateEvents(1000);
const originalLength = mermaidify(events, -1)!.length;
const limitedLengthZero = mermaidify(events, 0)!.length;
const limitedLengthOne = mermaidify(events, 1)!.length;
const limitedLengthTwo = mermaidify(events, 2)!.length;
expect(originalLength).greaterThan(limitedLengthZero);
expect(limitedLengthZero).greaterThan(limitedLengthOne);
expect(limitedLengthOne).greaterThan(limitedLengthTwo);
});
test("Generate a rough report of various length", () => {
const { events } = parseEvents([
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-0.drv",
outputs: ["/nix/store/qwlgz5da3pfb53gqpgdmazaj9jczrnly-dep-0"],
timing: {
startTime: "2025-04-11T14:38:02Z",
stopTime: "2025-04-11T14:38:05Z",
durationSeconds: 0,
},
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv",
outputs: ["/nix/store/qwlgz5da3pfb53gqpgdmazaj9jczrnly-dep-1"],
timing: {
startTime: "2025-04-11T14:38:02Z",
stopTime: "2025-04-11T14:38:05Z",
durationSeconds: 1,
},
},
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-2.drv",
outputs: ["/nix/store/qwlgz5da3pfb53gqpgdmazaj9jczrnly-dep-2"],
timing: {
startTime: "2025-04-11T14:38:02Z",
stopTime: "2025-04-11T14:38:05Z",
durationSeconds: 2,
},
},
{
v: "1",
c: "BuildFailureResponseEventV1",
drv: "/nix/store/ykvbksjqrza2zpj6nkbycrdfwgfdpr8g-hash-mismatch-md5-base16.drv",
timing: {
startTime: "2025-04-11T14:38:05Z",
stopTime: "2025-04-11T14:38:09Z",
durationSeconds: 4,
},
},
]);
expect(mermaidify(events, -1)).toStrictEqual(`\`\`\`mermaid
gantt
dateFormat X
axisFormat %Mm%Ss
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-0.drv (0s):d, 0, 0s
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-1.drv (1s):d, 0, 1s
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-2.drv (2s):d, 0, 2s
/nix/store/ykvbksjqrza2zpj6nkbycrdfwgfdpr8g-hash-mismatch-md5-base16.drv (4s):crit, 3, 4s
\`\`\``);
expect(mermaidify(events, 0)).toStrictEqual(`\`\`\`mermaid
gantt
dateFormat X
axisFormat %Mm%Ss
dep-0 (0s):d, 0, 0s
dep-1 (1s):d, 0, 1s
dep-2 (2s):d, 0, 2s
hash-mismatch-md5-base16 (4s):crit, 3, 4s
\`\`\``);
expect(mermaidify(events, 1)).toStrictEqual(`\`\`\`mermaid
gantt
dateFormat X
axisFormat %Mm%Ss
dep-1 (1s):d, 0, 1s
dep-2 (2s):d, 0, 2s
hash-mismatch-md5-base16 (4s):crit, 3, 4s
\`\`\``);
});
test("Generate a really big report and shrink it", () => {
const events = generateEvents(1000);
const originalLength = mermaidify(events, -1)!.length;
const limitedLengthZero = mermaidify(events, 0)!.length;
const limitedLengthOne = mermaidify(events, 1)!.length;
const limitedLengthTwo = mermaidify(events, 2)!.length;
expect(originalLength).greaterThan(limitedLengthZero);
expect(limitedLengthZero).greaterThan(limitedLengthOne);
expect(limitedLengthOne).greaterThan(limitedLengthTwo);
});
test("Really long builds get multi-unit timestamps", () => {
const { events } = parseEvents([
{
v: "1",
c: "BuiltPathResponseEventV1",
drv: "/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-0.drv",
outputs: ["/nix/store/qwlgz5da3pfb53gqpgdmazaj9jczrnly-dep-0"],
timing: {
startTime: "2025-04-11T14:38:02Z",
stopTime: "2026-05-14T13:32:01Z",
durationSeconds: 34383239,
},
},
]);
expect(mermaidify(events, -1)).toStrictEqual(`\`\`\`mermaid
gantt
dateFormat X
axisFormat %Mm%Ss
/nix/store/rz9hrpay90sjrid5hx3x8v606ji679xa-dep-0.drv (573053m59s):d, 0, 34383239s
\`\`\``);
});
+96
View File
@@ -0,0 +1,96 @@
import { DEvent } from "./events.js";
import { truncateDerivation } from "./util.js";
export function makeMermaidReport(events: DEvent[]): string | undefined {
// # 50k is the max: https://github.com/mermaid-js/mermaid/blob/c269dc822c528e1afbde34e18a1cad03d972d4fe/src/defaultConfig.js#L55
const maxLength = 49900;
let mermaid = "";
let pruneLevel = -2;
do {
pruneLevel += 1;
mermaid = mermaidify(events, pruneLevel) ?? "";
} while (mermaid.length > maxLength);
if (!mermaid) {
return undefined;
}
const lines = [
"<details open><summary><strong>Build timeline</strong> :hourglass_flowing_sand:</summary>",
"", // load bearing whitespace, deleting it breaks the details expander / markdown
mermaid,
"", // load bearing whitespace, deleting it breaks the details expander / markdown
];
if (pruneLevel === 0) {
lines.push("> [!NOTE]");
lines.push(
"> `/nix/store/[hash]` and the `.drv` suffixes have been removed to make the graph small enough to render.",
);
} else if (pruneLevel > 0) {
lines.push("> [!NOTE]");
lines.push(
`> \`/nix/store/[hash]\`, the \`.drv\` suffix, and builds that took less than ${formatDuration(pruneLevel)} have been removed to make the graph small enough to render.`,
);
}
lines.push(""); // load bearing whitespace, deleting it breaks the details expander / markdown
lines.push("</details>");
return lines.join("\n");
}
export function mermaidify(
allEvents: DEvent[],
pruneLevel: number,
): string | undefined {
const events = allEvents
.filter(
(event) =>
event.c === "BuiltPathResponseEventV1" ||
event.c === "BuildFailureResponseEventV1",
)
.sort(
(a, b) => a.timing.startTime.getTime() - b.timing.startTime.getTime(),
);
const firstEvent = events.at(0);
if (firstEvent === undefined) {
return undefined;
}
const zeroMoment = firstEvent.timing.startTime.getTime();
const lines = [
"```mermaid",
"gantt",
" dateFormat X",
" axisFormat %Mm%Ss",
];
for (const event of events) {
const duration = event.timing.durationSeconds;
if (duration < pruneLevel) {
continue;
}
const label = pruneLevel >= 0 ? truncateDerivation(event.drv) : event.drv;
const tag = event.c === "BuildFailureResponseEventV1" ? "crit" : "d";
const relativeStartTime =
(event.timing.startTime.getTime() - zeroMoment) / 1000;
lines.push(
`${label} (${formatDuration(duration)}):${tag}, ${relativeStartTime}, ${duration}s`,
);
}
lines.push("```");
return lines.join("\n");
}
function formatDuration(duration: number): string {
const durSeconds = duration % 60;
const durMinutes = (duration - durSeconds) / 60;
return `${durMinutes > 0 ? `${durMinutes}m` : ""}${durSeconds}s`;
}
+3
View File
@@ -0,0 +1,3 @@
export function truncateDerivation(drv: string): string {
return drv.replace(/^\/nix\/store\/[a-z0-9]+-/, "").replace(/\.drv$/, "");
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"module": "Node16",
"moduleResolution": "NodeNext",
"outDir": "./dist",
@@ -11,5 +11,5 @@
"resolveJsonModule": true,
"declaration": true
},
"exclude": ["node_modules", "**/*.test.ts", "dist"]
"exclude": ["node_modules", "dist"]
}
+1 -1
View File
@@ -5,7 +5,7 @@ export default defineConfig({
name,
entry: ["src/index.ts"],
format: ["esm"],
target: "node20",
target: "node24",
bundle: true,
splitting: false,
clean: true,
+5
View File
@@ -0,0 +1,5 @@
export default {
test: {
exclude: ["**/node_modules/**", "**/.direnv/**"],
},
};