test: fail if nix isn't installed

This commit is contained in:
Graham Christensen 2024-04-18 14:09:07 -04:00
parent 9ebd242ac9
commit 04fbd5502b
3 changed files with 218 additions and 25 deletions

35
dist/index.js generated vendored
View file

@ -94412,7 +94412,7 @@ const got = source_create(defaults);
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/correlation.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/correlation.js
function identify(projectName) { function identify(projectName) {
@ -94494,9 +94494,9 @@ function hashEnvironmentVariables(prefix, variables) {
return `${prefix}-${hash.digest("hex")}`; return `${prefix}-${hash.digest("hex")}`;
} }
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/package.json ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/package.json
const package_namespaceObject = {"i8":"1.0.0"}; const package_namespaceObject = {"i8":"1.0.0"};
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/platform.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/platform.js
/** /**
* @packageDocumentation * @packageDocumentation
* Helpers for determining system attributes of the current runner. * Helpers for determining system attributes of the current runner.
@ -94536,7 +94536,7 @@ function getNixPlatform(archOs) {
} }
} }
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/inputs.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/inputs.js
/** /**
* @packageDocumentation * @packageDocumentation
* Helpers for getting values from an Action's configuration. * Helpers for getting values from an Action's configuration.
@ -94604,7 +94604,7 @@ const getStringOrUndefined = (name) => {
}; };
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/sourcedef.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/sourcedef.js
function constructSourceParameters(legacyPrefix) { function constructSourceParameters(legacyPrefix) {
@ -94656,7 +94656,7 @@ const validate = uuid_dist/* validate */.Gu;
const stringify = uuid_dist/* stringify */.Pz; const stringify = uuid_dist/* stringify */.Pz;
const parse = uuid_dist/* parse */.Qc; const parse = uuid_dist/* parse */.Qc;
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d0549728861cc4c4797fddc2c931739ff5f7c819_aivncslwkd46yrth3vskk4g6rm/node_modules/detsys-ts/dist/main.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@26785e47ea40f359156ca7ce0fa3a3dafffd424e_sruplfqlal7bu74f2oc3e3r6zm/node_modules/detsys-ts/dist/main.js
/** /**
* @packageDocumentation * @packageDocumentation
* Determinate Systems' TypeScript library for creating GitHub Actions logic. * Determinate Systems' TypeScript library for creating GitHub Actions logic.
@ -94951,18 +94951,29 @@ class IdsToolbox {
} }
} }
this.addFact("nix_location", nixLocation || ""); this.addFact("nix_location", nixLocation || "");
if (this.actionOptions.requireNix === "ignore") {
return true;
}
const currentNotFoundState = core.getState("idstoolbox_nix_not_found"); const currentNotFoundState = core.getState("idstoolbox_nix_not_found");
if (this.actionOptions.requireNix && currentNotFoundState === "not-found") { if (currentNotFoundState === "not-found") {
// It was previously not found, so don't run subsequent actions // It was previously not found, so don't run subsequent actions
return false; return false;
} }
if (this.actionOptions.requireNix && nixLocation === undefined) { if (nixLocation !== undefined) {
return true;
}
core.saveState("idstoolbox_nix_not_found", "not-found");
switch (this.actionOptions.requireNix) {
case "fail":
core.error("This action can only be used when Nix is installed." +
" Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow.");
break;
case "warn":
core.warning("This action is in no-op mode because Nix is not installed." + core.warning("This action is in no-op mode because Nix is not installed." +
" Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow."); " Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow.");
core.saveState("idstoolbox_nix_not_found", "not-found"); break;
return false;
} }
return true; return false;
} }
async submitEvents() { async submitEvents() {
if (!this.actionOptions.diagnosticsUrl) { if (!this.actionOptions.diagnosticsUrl) {
@ -95330,7 +95341,7 @@ const idslib = new IdsToolbox({
name: "magic-nix-cache", name: "magic-nix-cache",
fetchStyle: "gh-env-style", fetchStyle: "gh-env-style",
idsProjectName: "magic-nix-cache-closure", idsProjectName: "magic-nix-cache-closure",
requireNix: true, requireNix: "fail",
}); });
idslib.onMain(async () => { idslib.onMain(async () => {
await setUpAutoCache(idslib); await setUpAutoCache(idslib);

View file

@ -19,7 +19,7 @@ dependencies:
version: 2.0.1 version: 2.0.1
detsys-ts: detsys-ts:
specifier: github:DeterminateSystems/detsys-ts#graham/fh-272-detsys-ts-create-a-helper-to-assert-nix-is-available-ahead specifier: github:DeterminateSystems/detsys-ts#graham/fh-272-detsys-ts-create-a-helper-to-assert-nix-is-available-ahead
version: github.com/DeterminateSystems/detsys-ts/d0549728861cc4c4797fddc2c931739ff5f7c819 version: github.com/DeterminateSystems/detsys-ts/26785e47ea40f359156ca7ce0fa3a3dafffd424e
fetch-retry: fetch-retry:
specifier: ^5.0.6 specifier: ^5.0.6
version: 5.0.6 version: 5.0.6
@ -48,7 +48,7 @@ devDependencies:
version: 9.0.8 version: 9.0.8
"@typescript-eslint/eslint-plugin": "@typescript-eslint/eslint-plugin":
specifier: ^7.6.0 specifier: ^7.6.0
version: 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) version: 7.6.0(@typescript-eslint/parser@7.7.0)(eslint@8.57.0)(typescript@5.4.5)
"@vercel/ncc": "@vercel/ncc":
specifier: ^0.38.1 specifier: ^0.38.1
version: 0.38.1 version: 0.38.1
@ -57,13 +57,13 @@ devDependencies:
version: 8.57.0 version: 8.57.0
eslint-import-resolver-typescript: eslint-import-resolver-typescript:
specifier: ^3.6.1 specifier: ^3.6.1
version: 3.6.1(@typescript-eslint/parser@7.6.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) version: 3.6.1(@typescript-eslint/parser@7.7.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0)
eslint-plugin-github: eslint-plugin-github:
specifier: ^4.10.2 specifier: ^4.10.2
version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5) version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5)
eslint-plugin-import: eslint-plugin-import:
specifier: ^2.29.1 specifier: ^2.29.1
version: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) version: 2.29.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: ^5.1.3 specifier: ^5.1.3
version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5)
@ -951,6 +951,38 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.7.0)(eslint@8.57.0)(typescript@5.4.5):
resolution:
{
integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
peerDependencies:
"@typescript-eslint/parser": ^7.0.0
eslint: ^8.56.0
typescript: "*"
peerDependenciesMeta:
typescript:
optional: true
dependencies:
"@eslint-community/regexpp": 4.10.0
"@typescript-eslint/parser": 7.7.0(eslint@8.57.0)(typescript@5.4.5)
"@typescript-eslint/scope-manager": 7.6.0
"@typescript-eslint/type-utils": 7.6.0(eslint@8.57.0)(typescript@5.4.5)
"@typescript-eslint/utils": 7.6.0(eslint@8.57.0)(typescript@5.4.5)
"@typescript-eslint/visitor-keys": 7.6.0
debug: 4.3.4
eslint: 8.57.0
graphemer: 1.4.0
ignore: 5.3.1
natural-compare: 1.4.0
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5): /@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5):
resolution: resolution:
{ {
@ -975,6 +1007,30 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.4.5):
resolution:
{
integrity: sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
peerDependencies:
eslint: ^8.56.0
typescript: "*"
peerDependenciesMeta:
typescript:
optional: true
dependencies:
"@typescript-eslint/scope-manager": 7.7.0
"@typescript-eslint/types": 7.7.0
"@typescript-eslint/typescript-estree": 7.7.0(typescript@5.4.5)
"@typescript-eslint/visitor-keys": 7.7.0
debug: 4.3.4
eslint: 8.57.0
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/scope-manager@7.6.0: /@typescript-eslint/scope-manager@7.6.0:
resolution: resolution:
{ {
@ -986,6 +1042,17 @@ packages:
"@typescript-eslint/visitor-keys": 7.6.0 "@typescript-eslint/visitor-keys": 7.6.0
dev: true dev: true
/@typescript-eslint/scope-manager@7.7.0:
resolution:
{
integrity: sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
dependencies:
"@typescript-eslint/types": 7.7.0
"@typescript-eslint/visitor-keys": 7.7.0
dev: true
/@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): /@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5):
resolution: resolution:
{ {
@ -1017,6 +1084,14 @@ packages:
engines: { node: ^18.18.0 || >=20.0.0 } engines: { node: ^18.18.0 || >=20.0.0 }
dev: true dev: true
/@typescript-eslint/types@7.7.0:
resolution:
{
integrity: sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
dev: true
/@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5): /@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5):
resolution: resolution:
{ {
@ -1042,6 +1117,31 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/typescript-estree@7.7.0(typescript@5.4.5):
resolution:
{
integrity: sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
peerDependencies:
typescript: "*"
peerDependenciesMeta:
typescript:
optional: true
dependencies:
"@typescript-eslint/types": 7.7.0
"@typescript-eslint/visitor-keys": 7.7.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.4
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): /@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5):
resolution: resolution:
{ {
@ -1075,6 +1175,17 @@ packages:
eslint-visitor-keys: 3.4.3 eslint-visitor-keys: 3.4.3
dev: true dev: true
/@typescript-eslint/visitor-keys@7.7.0:
resolution:
{
integrity: sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==,
}
engines: { node: ^18.18.0 || >=20.0.0 }
dependencies:
"@typescript-eslint/types": 7.7.0
eslint-visitor-keys: 3.4.3
dev: true
/@ungap/structured-clone@1.2.0: /@ungap/structured-clone@1.2.0:
resolution: resolution:
{ {
@ -1888,7 +1999,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.6.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.7.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0):
resolution: resolution:
{ {
integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==, integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==,
@ -1901,8 +2012,8 @@ packages:
debug: 4.3.4 debug: 4.3.4
enhanced-resolve: 5.16.0 enhanced-resolve: 5.16.0
eslint: 8.57.0 eslint: 8.57.0
eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
fast-glob: 3.3.2 fast-glob: 3.3.2
get-tsconfig: 4.7.3 get-tsconfig: 4.7.3
is-core-module: 2.13.1 is-core-module: 2.13.1
@ -1942,7 +2053,40 @@ packages:
debug: 3.2.7 debug: 3.2.7
eslint: 8.57.0 eslint: 8.57.0
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.6.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.7.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0)
transitivePeerDependencies:
- supports-color
dev: true
/eslint-module-utils@2.8.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
resolution:
{
integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==,
}
engines: { node: ">=4" }
peerDependencies:
"@typescript-eslint/parser": "*"
eslint: "*"
eslint-import-resolver-node: "*"
eslint-import-resolver-typescript: "*"
eslint-import-resolver-webpack: "*"
peerDependenciesMeta:
"@typescript-eslint/parser":
optional: true
eslint:
optional: true
eslint-import-resolver-node:
optional: true
eslint-import-resolver-typescript:
optional: true
eslint-import-resolver-webpack:
optional: true
dependencies:
"@typescript-eslint/parser": 7.7.0(eslint@8.57.0)(typescript@5.4.5)
debug: 3.2.7
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.7.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: true dev: true
@ -2072,6 +2216,44 @@ packages:
- supports-color - supports-color
dev: true dev: true
/eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
resolution:
{
integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==,
}
engines: { node: ">=4" }
peerDependencies:
"@typescript-eslint/parser": "*"
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
peerDependenciesMeta:
"@typescript-eslint/parser":
optional: true
dependencies:
"@typescript-eslint/parser": 7.7.0(eslint@8.57.0)(typescript@5.4.5)
array-includes: 3.1.8
array.prototype.findlastindex: 1.2.5
array.prototype.flat: 1.3.2
array.prototype.flatmap: 1.3.2
debug: 3.2.7
doctrine: 2.1.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
hasown: 2.0.2
is-core-module: 2.13.1
is-glob: 4.0.3
minimatch: 3.1.2
object.fromentries: 2.0.8
object.groupby: 1.0.3
object.values: 1.2.0
semver: 6.3.1
tsconfig-paths: 3.15.0
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
dev: true
/eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): /eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0):
resolution: resolution:
{ {
@ -4353,10 +4535,10 @@ packages:
engines: { node: ">=10" } engines: { node: ">=10" }
dev: true dev: true
github.com/DeterminateSystems/detsys-ts/d0549728861cc4c4797fddc2c931739ff5f7c819: github.com/DeterminateSystems/detsys-ts/26785e47ea40f359156ca7ce0fa3a3dafffd424e:
resolution: resolution:
{ {
tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/d0549728861cc4c4797fddc2c931739ff5f7c819, tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/26785e47ea40f359156ca7ce0fa3a3dafffd424e,
} }
name: detsys-ts name: detsys-ts
version: 1.0.0 version: 1.0.0

View file

@ -305,7 +305,7 @@ const idslib = new IdsToolbox({
name: "magic-nix-cache", name: "magic-nix-cache",
fetchStyle: "gh-env-style", fetchStyle: "gh-env-style",
idsProjectName: "magic-nix-cache-closure", idsProjectName: "magic-nix-cache-closure",
requireNix: true, requireNix: "fail",
}); });
idslib.onMain(async () => { idslib.onMain(async () => {