From 636193b25b41c21f1544114b14d8f7f99526c1af Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 4 Jun 2024 00:57:00 +0900 Subject: [PATCH 01/33] ci(.github/workflows/lint.yml): only install necessary tools --- .github/workflows/lint.yml | 18 +++++++++ .github/workflows/scripts/list-mise-tasks.ts | 41 ++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 28925b2b..4dc866e2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,8 +33,15 @@ jobs: - name: Install mise uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6 with: + install: false + # cspell:ignore bunnodeubi + cache_key_prefix: mise-v0-bunnodeubi experimental: true + - name: Install backend tools + # node and ubi are required to run mise list + run: mise install --verbose bun node ubi + - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -67,8 +74,13 @@ jobs: - name: Install mise uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6 with: + install: false + cache_key_prefix: mise-v0-${{ matrix.cacheKey }} experimental: true + - name: Install lint tools + run: mise install --verbose ${{ matrix.tools }} + - name: Lint run: mise run ${{ matrix.task }} @@ -87,8 +99,14 @@ jobs: - name: Install mise uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6 with: + install: false + # cspell:ignore bunnode + cache_key_prefix: mise-v0-bunnode experimental: true + - name: Install bun and Node.js + run: mise install --verbose bun node + - name: Install package.json dependencies run: mise run buni:root diff --git a/.github/workflows/scripts/list-mise-tasks.ts b/.github/workflows/scripts/list-mise-tasks.ts index cfa3850a..6d60dcbd 100644 --- a/.github/workflows/scripts/list-mise-tasks.ts +++ b/.github/workflows/scripts/list-mise-tasks.ts @@ -11,6 +11,10 @@ $.throws(true); const ciTaskDepsDot = await $`mise tasks deps ci --dot`.text(); +const miseTools = Object.keys( + (await $`mise list --current --json`.json()) as Record, +); + const ciTasks = fromDot(ciTaskDepsDot); const rootNode = ciTasks.nodes.find( @@ -54,9 +58,21 @@ const getNodeLabel = (node: NodeModel) => { return label; }; +const getDependencies = ({ id }: NodeRef): NodeRef[] => { + return ciTasks.edges + .map(getEdgeTargets) + .filter(({ from }) => from.id === id) + .flatMap(({ to }) => [to, ...getDependencies(to)]); +}; + +const identifierSeparator = /:|\//; + const tasks: { name: string; task: string; + // space separated list to use in `mise install` command + tools: string; + cacheKey: string; }[] = ciTasks.edges .map(getEdgeTargets) .filter(({ from }) => from.id === rootNode.id) @@ -64,9 +80,34 @@ const tasks: { const taskName = getNodeLabel(getNodeFromRef(to)); // remove prefix if exists const name = taskName.split(":")[1] ?? taskName; + const tool = miseTools.find((tool) => tool.includes(name)); + + const tools: string[] = tool ? [tool] : []; + + if (tool?.startsWith("npm")) { + tools.push("node"); + } + if (tool?.startsWith("ubi")) { + tools.push("ubi"); + } + + const dependencies = getDependencies(to).map((node) => + getNodeLabel(getNodeFromRef(node)), + ); + // cspell:ignore buni + if (dependencies.some((dependency) => dependency.startsWith("buni"))) { + tools.push("bun", "node"); + } + return { name: name, task: taskName, + tools: tools.join(" "), + cacheKey: tools + // remove prefix if exists + .map((tool) => tool.split(identifierSeparator).at(-1) ?? tool) + .sort() + .join(""), }; }); From 086a6ada961f17f25e3fd303435e54aa586cc6ff Mon Sep 17 00:00:00 2001 From: risu729 Date: Sat, 21 Sep 2024 17:23:35 +0900 Subject: [PATCH 02/33] fix(.github/workflows/lint.yml): remove second mise install attempt --- .github/workflows/lint.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4b1d05c7..b6c9debf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,16 +40,6 @@ jobs: # cspell:ignore bunnodeubi cache_key_prefix: mise-v0-bunnodeubi experimental: true - # cspell:ignore reshim - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim --verbose - - - name: Install mise tools - run: mise install --verbose - name: Install backend tools # node and ubi are required to run mise list @@ -90,15 +80,6 @@ jobs: install: false cache_key_prefix: mise-v0-${{ matrix.cacheKey }} experimental: true - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim --verbose - - - name: Install mise tools - run: mise install --verbose - name: Install lint tools run: mise install --verbose ${{ matrix.tools }} @@ -125,15 +106,6 @@ jobs: # cspell:ignore bunnode cache_key_prefix: mise-v0-bunnode experimental: true - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim --verbose - - - name: Install mise tools - run: mise install --verbose - name: Install bun and Node.js run: mise install --verbose bun node From c60f136d72a80186fbc6786dd63cbe6763d5a056 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 20:37:42 +0900 Subject: [PATCH 03/33] ci(.github/workflows/lint.yml): do not use mise run for bun install --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b6c9debf..cd70ae7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,7 +46,7 @@ jobs: run: mise install --verbose bun node ubi - name: Install package.json dependencies - run: mise run buni:root # cspell:ignore buni + run: bun install # cspell:ignore buni - name: List mise tasks id: list @@ -111,7 +111,7 @@ jobs: run: mise install --verbose bun node - name: Install package.json dependencies - run: mise run buni:root + run: bun install - name: "commitlint (push: initial commit)" id: commitlint-push-initial From 5711893ff5063ae7023e5c00cddaba0d1d250da3 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 21:34:59 +0900 Subject: [PATCH 04/33] ci(.github/workflows/lint.yml): show content of msgpack mise cache --- .github/workflows/lint.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd70ae7e..785f1a6c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -99,6 +99,10 @@ jobs: with: fetch-depth: 0 # fetch all history for commitlint + - run: | + wget https://github.com/ludocode/msgpack-tools/releases/download/v0.6/msgpack-tools-0.6-x86_64.deb + sudo apt install ./msgpack-tools-0.6-x86_64.deb + - name: Install mise uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6 with: @@ -110,6 +114,15 @@ jobs: - name: Install bun and Node.js run: mise install --verbose bun node + - run: which bun + + - run: ls -aR /home/runner/.cache/mise + + - run: | + cat /home/runner/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z | \ + perl -e 'use Compress::Raw::Zlib;my $d=new Compress::Raw::Zlib::Inflate();my $o;undef $/;$d->inflate(<>,$o);print $o;' | \ + msgpack2json -d + - name: Install package.json dependencies run: bun install From f29b33590c6aeb3a123a9f5d078300d68d6ea33f Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 23:15:53 +0900 Subject: [PATCH 05/33] Revert "ci(.github/workflows/lint.yml): show content of msgpack mise cache" This reverts commit 5711893ff5063ae7023e5c00cddaba0d1d250da3. --- .github/workflows/lint.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 785f1a6c..cd70ae7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -99,10 +99,6 @@ jobs: with: fetch-depth: 0 # fetch all history for commitlint - - run: | - wget https://github.com/ludocode/msgpack-tools/releases/download/v0.6/msgpack-tools-0.6-x86_64.deb - sudo apt install ./msgpack-tools-0.6-x86_64.deb - - name: Install mise uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6 with: @@ -114,15 +110,6 @@ jobs: - name: Install bun and Node.js run: mise install --verbose bun node - - run: which bun - - - run: ls -aR /home/runner/.cache/mise - - - run: | - cat /home/runner/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z | \ - perl -e 'use Compress::Raw::Zlib;my $d=new Compress::Raw::Zlib::Inflate();my $o;undef $/;$d->inflate(<>,$o);print $o;' | \ - msgpack2json -d - - name: Install package.json dependencies run: bun install From 8b6fc13916abc03665e6750fbc11351a920e98bf Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 23:17:23 +0900 Subject: [PATCH 06/33] ci(.github/workflows/lint.yml): list all mise cache files for debug --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd70ae7e..e2d2b2cb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,6 +45,8 @@ jobs: # node and ubi are required to run mise list run: mise install --verbose bun node ubi + - run: ls -aR /home/runner/.cache/mise + - name: Install package.json dependencies run: bun install # cspell:ignore buni @@ -110,6 +112,8 @@ jobs: - name: Install bun and Node.js run: mise install --verbose bun node + - run: ls -aR /home/runner/.cache/mise + - name: Install package.json dependencies run: bun install From 806ab7da2fc1223daa875b3b744037a89d3d5660 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 23:39:40 +0900 Subject: [PATCH 07/33] Revert "ci(.github/workflows/lint.yml): list all mise cache files for debug" This reverts commit 8b6fc13916abc03665e6750fbc11351a920e98bf. --- .github/workflows/lint.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e2d2b2cb..cd70ae7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,8 +45,6 @@ jobs: # node and ubi are required to run mise list run: mise install --verbose bun node ubi - - run: ls -aR /home/runner/.cache/mise - - name: Install package.json dependencies run: bun install # cspell:ignore buni @@ -112,8 +110,6 @@ jobs: - name: Install bun and Node.js run: mise install --verbose bun node - - run: ls -aR /home/runner/.cache/mise - - name: Install package.json dependencies run: bun install From de27ea9c91960d2baa91a45ac497d35625ca8d66 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 23:43:01 +0900 Subject: [PATCH 08/33] ci(.github/workflows/lint.yml): disable mise auto install --- .github/workflows/lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd70ae7e..17c5958c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,6 +29,9 @@ jobs: outputs: tasks: ${{ steps.list.outputs.tasks }} + env: + MISE_NOT_FOUND_AUTO_INSTALL: false + steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -41,6 +44,8 @@ jobs: cache_key_prefix: mise-v0-bunnodeubi experimental: true + - run: mise doctor + - name: Install backend tools # node and ubi are required to run mise list run: mise install --verbose bun node ubi @@ -107,6 +112,8 @@ jobs: cache_key_prefix: mise-v0-bunnode experimental: true + - run: mise doctor + - name: Install bun and Node.js run: mise install --verbose bun node From 1483b9f8ec37843c25ac5542d0c2e5d65a2a2b43 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 23 Sep 2024 23:51:21 +0900 Subject: [PATCH 09/33] ci(.github/workflows/lint.yml): exchange the job disabling mise auto instlal --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 17c5958c..1bfd0879 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,9 +29,6 @@ jobs: outputs: tasks: ${{ steps.list.outputs.tasks }} - env: - MISE_NOT_FOUND_AUTO_INSTALL: false - steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -98,6 +95,9 @@ jobs: permissions: contents: read # for checkout + env: + MISE_NOT_FOUND_AUTO_INSTALL: false + steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 From 4d91af5b15b919f144de103b0e4d81f16985e00d Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 18:48:31 +0900 Subject: [PATCH 10/33] ci(.github/workflows/lint.yml): enable logging --- .github/workflows/lint.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1bfd0879..797e11af 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,6 +29,10 @@ jobs: outputs: tasks: ${{ steps.list.outputs.tasks }} + env: + MISE_LOG_LEVEL: trace + RUST_BACKTRACE: full + steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -48,7 +52,7 @@ jobs: run: mise install --verbose bun node ubi - name: Install package.json dependencies - run: bun install # cspell:ignore buni + run: mise x -- bun install # cspell:ignore buni - name: List mise tasks id: list @@ -96,7 +100,8 @@ jobs: contents: read # for checkout env: - MISE_NOT_FOUND_AUTO_INSTALL: false + MISE_LOG_LEVEL: trace + RUST_BACKTRACE: full steps: - name: Checkout From 388880ba1cc68b6502136a1739c975500d22abe2 Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 19:32:13 +0900 Subject: [PATCH 11/33] ci(.github/workflows/lint.yml): limit rayon max number of threads --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 797e11af..8c5db422 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,7 @@ jobs: env: MISE_LOG_LEVEL: trace RUST_BACKTRACE: full + RAYON_NUM_THREADS: 1 steps: - name: Checkout @@ -102,6 +103,7 @@ jobs: env: MISE_LOG_LEVEL: trace RUST_BACKTRACE: full + RAYON_NUM_THREADS: 1 steps: - name: Checkout From a892e6713599bf5b44a8a56d143bbe42e34b6434 Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 19:39:32 +0900 Subject: [PATCH 12/33] ci(.github/workflows/lint.yml): remove lines for debug --- .github/workflows/lint.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c5db422..0f25c1ac 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,6 @@ jobs: env: MISE_LOG_LEVEL: trace RUST_BACKTRACE: full - RAYON_NUM_THREADS: 1 steps: - name: Checkout @@ -46,14 +45,12 @@ jobs: cache_key_prefix: mise-v0-bunnodeubi experimental: true - - run: mise doctor - - name: Install backend tools # node and ubi are required to run mise list run: mise install --verbose bun node ubi - name: Install package.json dependencies - run: mise x -- bun install # cspell:ignore buni + run: bun install # cspell:ignore buni - name: List mise tasks id: list @@ -103,7 +100,6 @@ jobs: env: MISE_LOG_LEVEL: trace RUST_BACKTRACE: full - RAYON_NUM_THREADS: 1 steps: - name: Checkout @@ -119,8 +115,6 @@ jobs: cache_key_prefix: mise-v0-bunnode experimental: true - - run: mise doctor - - name: Install bun and Node.js run: mise install --verbose bun node From c4a7878ca75649abd5b202dc811fbe726c021603 Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 19:40:54 +0900 Subject: [PATCH 13/33] ci(.github/workflows/lint.yml): remove node from mise shims --- .github/workflows/lint.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0f25c1ac..67832d1d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,7 +47,9 @@ jobs: - name: Install backend tools # node and ubi are required to run mise list - run: mise install --verbose bun node ubi + run: mise install --verbose bun ubi + + - run: which node - name: Install package.json dependencies run: bun install # cspell:ignore buni @@ -116,7 +118,9 @@ jobs: experimental: true - name: Install bun and Node.js - run: mise install --verbose bun node + run: mise install --verbose bun + + - run: which node - name: Install package.json dependencies run: bun install From d05cf7748cad140dc9a08090d05d30c1c807f978 Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 19:45:31 +0900 Subject: [PATCH 14/33] Revert "ci(.github/workflows/lint.yml): remove node from mise shims" This reverts commit c4a7878ca75649abd5b202dc811fbe726c021603. --- .github/workflows/lint.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 67832d1d..0f25c1ac 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,9 +47,7 @@ jobs: - name: Install backend tools # node and ubi are required to run mise list - run: mise install --verbose bun ubi - - - run: which node + run: mise install --verbose bun node ubi - name: Install package.json dependencies run: bun install # cspell:ignore buni @@ -118,9 +116,7 @@ jobs: experimental: true - name: Install bun and Node.js - run: mise install --verbose bun - - - run: which node + run: mise install --verbose bun node - name: Install package.json dependencies run: bun install From d60cfc78652969771c8c927b9914d234d779cdc4 Mon Sep 17 00:00:00 2001 From: risu729 Date: Tue, 24 Sep 2024 19:46:18 +0900 Subject: [PATCH 15/33] ci(.github/workflows/lint.yml): run mise for debug --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0f25c1ac..5bbedcdf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,6 +49,8 @@ jobs: # node and ubi are required to run mise list run: mise install --verbose bun node ubi + - run: mise + - name: Install package.json dependencies run: bun install # cspell:ignore buni From 1aca8d1e0ab98308a9ebd9aaa2cc7298c211b9d3 Mon Sep 17 00:00:00 2001 From: risu729 Date: Thu, 26 Sep 2024 22:48:59 +0900 Subject: [PATCH 16/33] ci(.github/workflows/lint.yml): cleanup lines for debug --- .github/workflows/lint.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd026e68..51dc4134 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,10 +29,6 @@ jobs: outputs: tasks: ${{ steps.list.outputs.tasks }} - env: - MISE_LOG_LEVEL: trace - RUST_BACKTRACE: full - steps: - name: Checkout uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -47,12 +43,10 @@ jobs: - name: Install backend tools # node and ubi are required to run mise list - run: mise install --verbose bun node ubi - - - run: mise + run: mise install bun node ubi - name: Install package.json dependencies - run: bun install # cspell:ignore buni + run: mise run buni:root # cspell:ignore buni - name: List mise tasks id: list @@ -99,10 +93,6 @@ jobs: permissions: contents: read # for checkout - env: - MISE_LOG_LEVEL: trace - RUST_BACKTRACE: full - steps: - name: Checkout uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -118,10 +108,10 @@ jobs: experimental: true - name: Install bun and Node.js - run: mise install --verbose bun node + run: mise install bun node - name: Install package.json dependencies - run: bun install + run: mise run buni:root - name: "commitlint (push: initial commit)" id: commitlint-push-initial From 870ec9af630fceca057f2541c02d983c6e849fb0 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 06:56:05 +0900 Subject: [PATCH 17/33] ci(.github/workflows/lint.yml): use install_args for mise install --- .github/workflows/lint.yml | 25 ++++++-------------- .github/workflows/scripts/list-mise-tasks.ts | 13 ++++------ 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 51dc4134..9f55e957 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,15 +36,11 @@ jobs: - name: Install mise uses: jdx/mise-action@f8dfbcc150159126838e44b882bf34bd98fd90f3 # v2.1.0 with: - install: false - # cspell:ignore bunnodeubi - cache_key_prefix: mise-v0-bunnodeubi + # node and ubi backends are required to run mise list + install_args: bun node ubi + cache_key_prefix: mise-v0-bun-node-ubi experimental: true - - name: Install backend tools - # node and ubi are required to run mise list - run: mise install bun node ubi - - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -77,13 +73,10 @@ jobs: - name: Install mise uses: jdx/mise-action@f8dfbcc150159126838e44b882bf34bd98fd90f3 # v2.1.0 with: - install: false - cache_key_prefix: mise-v0-${{ matrix.cacheKey }} + install_args: ${{ matrix.tools }} + cache_key_prefix: mise-v0-${{ matrix.toolsHash }} experimental: true - - name: Install lint tools - run: mise install --verbose ${{ matrix.tools }} - - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} @@ -102,14 +95,10 @@ jobs: - name: Install mise uses: jdx/mise-action@f8dfbcc150159126838e44b882bf34bd98fd90f3 # v2.1.0 with: - install: false - # cspell:ignore bunnode - cache_key_prefix: mise-v0-bunnode + install_args: bun node + cache_key_prefix: mise-v0-bun-node experimental: true - - name: Install bun and Node.js - run: mise install bun node - - name: Install package.json dependencies run: mise run buni:root diff --git a/.github/workflows/scripts/list-mise-tasks.ts b/.github/workflows/scripts/list-mise-tasks.ts index ee056e30..278456fc 100644 --- a/.github/workflows/scripts/list-mise-tasks.ts +++ b/.github/workflows/scripts/list-mise-tasks.ts @@ -1,3 +1,4 @@ +import { createHash } from "node:crypto"; import { $ } from "bun"; import { type EdgeModel, @@ -69,14 +70,12 @@ const getDependencies = ({ id }: NodeRef): NodeRef[] => { .flatMap(({ to }) => [to, ...getDependencies(to)]); }; -const identifierSeparator = /:|\//; - const tasks: { name: string; task: string; // space separated list to use in `mise install` command tools: string; - cacheKey: string; + toolsHash: string; }[] = ciTasks.edges .map(getEdgeTargets) .filter(({ from }) => from.id === rootNode.id) @@ -107,11 +106,9 @@ const tasks: { name: name, task: taskName, tools: tools.join(" "), - cacheKey: tools - // remove prefix if exists - .map((tool) => tool.split(identifierSeparator).at(-1) ?? tool) - .sort() - .join(""), + toolsHash: createHash("sha256") + .update(tools.sort().join("-")) + .digest("hex"), }; }); From eaaefffab13f04d1abb051e79b2b3215cb03ec57 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:05:54 +0900 Subject: [PATCH 18/33] Revert "fix(.github/workflows/lint.yml): remove second mise install attempt" This reverts commit 086a6ada961f17f25e3fd303435e54aa586cc6ff. --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9f55e957..33ceb33a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,6 +40,16 @@ jobs: install_args: bun node ubi cache_key_prefix: mise-v0-bun-node-ubi experimental: true + # cspell:ignore reshim + # mise reshim is required to avoid "No such file or directory" error + # ref: https://github.com/jdx/mise/issues/2260 + continue-on-error: true + + - name: Reshim mise + run: mise reshim --verbose + + - name: Install mise tools + run: mise install --verbose - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -76,6 +86,15 @@ jobs: install_args: ${{ matrix.tools }} cache_key_prefix: mise-v0-${{ matrix.toolsHash }} experimental: true + # mise reshim is required to avoid "No such file or directory" error + # ref: https://github.com/jdx/mise/issues/2260 + continue-on-error: true + + - name: Reshim mise + run: mise reshim --verbose + + - name: Install mise tools + run: mise install --verbose - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} @@ -98,6 +117,15 @@ jobs: install_args: bun node cache_key_prefix: mise-v0-bun-node experimental: true + # mise reshim is required to avoid "No such file or directory" error + # ref: https://github.com/jdx/mise/issues/2260 + continue-on-error: true + + - name: Reshim mise + run: mise reshim --verbose + + - name: Install mise tools + run: mise install --verbose - name: Install package.json dependencies run: mise run buni:root From b29816c427c6c926a45c8ad2ffc82f68fcbe8700 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:08:28 +0900 Subject: [PATCH 19/33] ci(.github/workflows/lint.yml): remove mise reshim for non-background related cases --- .github/workflows/lint.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 33ceb33a..2c68d83c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,16 +40,6 @@ jobs: install_args: bun node ubi cache_key_prefix: mise-v0-bun-node-ubi experimental: true - # cspell:ignore reshim - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim --verbose - - - name: Install mise tools - run: mise install --verbose - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -91,10 +81,10 @@ jobs: continue-on-error: true - name: Reshim mise - run: mise reshim --verbose + run: mise reshim - name: Install mise tools - run: mise install --verbose + run: mise install ${{ matrix.tools }} - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} @@ -117,15 +107,6 @@ jobs: install_args: bun node cache_key_prefix: mise-v0-bun-node experimental: true - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim --verbose - - - name: Install mise tools - run: mise install --verbose - name: Install package.json dependencies run: mise run buni:root From 409b7120a5bcbba914e8fc86841054379e8eba5c Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:39:20 +0900 Subject: [PATCH 20/33] ci(.github/workflows/lint.yml): remove npm shim to avoid mise infinite loop --- .github/workflows/lint.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2c68d83c..257a5275 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,6 +41,12 @@ jobs: cache_key_prefix: mise-v0-bun-node-ubi experimental: true + # remove npm shim to avoid infinite loop in mise while resolving tools + # should not cause any issue because npm is not used + # ref: https://github.com/jdx/mise/issues/2682 + - name: Remove npm shim + run: rm $(which npm) + - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -86,6 +92,12 @@ jobs: - name: Install mise tools run: mise install ${{ matrix.tools }} + # remove npm shim to avoid infinite loop in mise while resolving tools + # should not cause any issue because npm is not used + # ref: https://github.com/jdx/mise/issues/2682 + - name: Remove npm shim + run: rm $(which npm) + - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} @@ -108,6 +120,12 @@ jobs: cache_key_prefix: mise-v0-bun-node experimental: true + # remove npm shim to avoid infinite loop in mise while resolving tools + # should not cause any issue because npm is not used + # ref: https://github.com/jdx/mise/issues/2682 + - name: Remove npm shim + run: rm $(which npm) + - name: Install package.json dependencies run: mise run buni:root From df97378c2301c00aabe81c732cf841fbcf8f42e3 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:46:47 +0900 Subject: [PATCH 21/33] ci(.github/workflows/lint.yml): output which npm for debug --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 257a5275..fc4f7b3b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -98,6 +98,8 @@ jobs: - name: Remove npm shim run: rm $(which npm) + - run: which npm + - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} From 31979ac93455ad205b0d0a28c1818cabce4a5f88 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:50:13 +0900 Subject: [PATCH 22/33] ci(.github/workflows/lint.yml): debug --- .github/workflows/lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc4f7b3b..5e44179f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,6 +47,10 @@ jobs: - name: Remove npm shim run: rm $(which npm) + - run: which npm + + - run: mise x -- which npm + - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -98,8 +102,6 @@ jobs: - name: Remove npm shim run: rm $(which npm) - - run: which npm - - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} From e8f2ee883486c5033749d5490c2cb86cca0e35dd Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 08:54:07 +0900 Subject: [PATCH 23/33] ci(.github/workflows/lint.yml): remove whole shims directory for debug --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5e44179f..1af9d890 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,7 +45,7 @@ jobs: # should not cause any issue because npm is not used # ref: https://github.com/jdx/mise/issues/2682 - name: Remove npm shim - run: rm $(which npm) + run: rm -rf ~/.local/share/mise/shims - run: which npm From 16d3d2d29b2698fbf4aa0775358ecc07e74bf3fa Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:08:51 +0900 Subject: [PATCH 24/33] Revert "ci(.github/workflows/lint.yml): remove whole shims directory for debug" This reverts commit e8f2ee883486c5033749d5490c2cb86cca0e35dd. --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1af9d890..5e44179f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,7 +45,7 @@ jobs: # should not cause any issue because npm is not used # ref: https://github.com/jdx/mise/issues/2682 - name: Remove npm shim - run: rm -rf ~/.local/share/mise/shims + run: rm $(which npm) - run: which npm From 8a2cd372fbfc6a8f6425ef7969b40e79f4356e24 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:09:02 +0900 Subject: [PATCH 25/33] Revert "ci(.github/workflows/lint.yml): debug" This reverts commit 31979ac93455ad205b0d0a28c1818cabce4a5f88. --- .github/workflows/lint.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5e44179f..fc4f7b3b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,10 +47,6 @@ jobs: - name: Remove npm shim run: rm $(which npm) - - run: which npm - - - run: mise x -- which npm - - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni @@ -102,6 +98,8 @@ jobs: - name: Remove npm shim run: rm $(which npm) + - run: which npm + - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} From f97fc40caac8f0038ab74e2b3126495e6c2afe76 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:09:15 +0900 Subject: [PATCH 26/33] Revert "ci(.github/workflows/lint.yml): output which npm for debug" This reverts commit df97378c2301c00aabe81c732cf841fbcf8f42e3. --- .github/workflows/lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc4f7b3b..257a5275 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -98,8 +98,6 @@ jobs: - name: Remove npm shim run: rm $(which npm) - - run: which npm - - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} From 1ea68c8874b3ad457a5744000b87d43c266ed7aa Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:10:12 +0900 Subject: [PATCH 27/33] ci(.github/workflows/lint.yml): set mise log level to trace --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 257a5275..431fc035 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,6 +49,8 @@ jobs: - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni + env: + MISE_LOG_LEVEL: trace - name: List mise tasks id: list From b53ec7456f630ff03864286b1b4f9613fcc555b7 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:31:54 +0900 Subject: [PATCH 28/33] ci(.github/workflows/lint.yml): show npm binary for debug --- .github/workflows/lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 431fc035..9995f5ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,6 +47,11 @@ jobs: - name: Remove npm shim run: rm $(which npm) + - run: cat $(which npm) + + # stop here + - run: exit 1 + - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni env: From f00bd38d93fa3f90ec343c0f5bd6695bd55ff998 Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:37:22 +0900 Subject: [PATCH 29/33] ci(.github/workflows/lint.yml): cleanup debug codes --- .github/workflows/lint.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9995f5ed..2c68d83c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,21 +41,8 @@ jobs: cache_key_prefix: mise-v0-bun-node-ubi experimental: true - # remove npm shim to avoid infinite loop in mise while resolving tools - # should not cause any issue because npm is not used - # ref: https://github.com/jdx/mise/issues/2682 - - name: Remove npm shim - run: rm $(which npm) - - - run: cat $(which npm) - - # stop here - - run: exit 1 - - name: Install package.json dependencies run: mise run buni:root # cspell:ignore buni - env: - MISE_LOG_LEVEL: trace - name: List mise tasks id: list @@ -99,12 +86,6 @@ jobs: - name: Install mise tools run: mise install ${{ matrix.tools }} - # remove npm shim to avoid infinite loop in mise while resolving tools - # should not cause any issue because npm is not used - # ref: https://github.com/jdx/mise/issues/2682 - - name: Remove npm shim - run: rm $(which npm) - - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} @@ -127,12 +108,6 @@ jobs: cache_key_prefix: mise-v0-bun-node experimental: true - # remove npm shim to avoid infinite loop in mise while resolving tools - # should not cause any issue because npm is not used - # ref: https://github.com/jdx/mise/issues/2682 - - name: Remove npm shim - run: rm $(which npm) - - name: Install package.json dependencies run: mise run buni:root From e727137646c1bab7ebd17c8fee574fbfd0f21e5e Mon Sep 17 00:00:00 2001 From: risu729 Date: Fri, 4 Oct 2024 17:42:04 +0900 Subject: [PATCH 30/33] ci(.github/workflows/lint.yml,wsl/install.sh): remove mise reshim workarounds --- .github/workflows/lint.yml | 9 --------- wsl/install.sh | 10 ---------- 2 files changed, 19 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2c68d83c..9f55e957 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -76,15 +76,6 @@ jobs: install_args: ${{ matrix.tools }} cache_key_prefix: mise-v0-${{ matrix.toolsHash }} experimental: true - # mise reshim is required to avoid "No such file or directory" error - # ref: https://github.com/jdx/mise/issues/2260 - continue-on-error: true - - - name: Reshim mise - run: mise reshim - - - name: Install mise tools - run: mise install ${{ matrix.tools }} - name: Run ${{ matrix.name }} run: mise run ${{ matrix.task }} diff --git a/wsl/install.sh b/wsl/install.sh index 95a1d5ba..4e902940 100755 --- a/wsl/install.sh +++ b/wsl/install.sh @@ -63,16 +63,6 @@ eval "${brew_env}" brew bundle install --global --no-lock echo installed Homebrew -# cspell:ignore reshim -# activate mise shims to use mise reshim -mise_shims="$(mise activate bash --shims)" -eval "${mise_shims}" - -# exit with 0 to ignore the error -mise install --yes || true -# mise reshim is required to avoid "No such file or directory" error -# ref: https://github.com/jdx/mise/issues/2260 -mise reshim mise install --yes echo installed mise From f88eee6213c63b85a1f3c2d676fe229c87eaaf5c Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 14 Oct 2024 20:52:45 +0900 Subject: [PATCH 31/33] ci(.github/workflows/lint.yml): remove ubi from backends --- .github/workflows/lint.yml | 6 +++--- .github/workflows/scripts/list-mise-tasks.ts | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 14f12720..fe3e38fe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,9 +36,9 @@ jobs: - name: Install mise uses: jdx/mise-action@f8dfbcc150159126838e44b882bf34bd98fd90f3 # v2.1.0 with: - # node and ubi backends are required to run mise list - install_args: bun node ubi - cache_key_prefix: mise-v0-bun-node-ubi + # backends are required to run mise list + install_args: bun node + cache_key_prefix: mise-v0-bun-node experimental: true - name: Install package.json dependencies diff --git a/.github/workflows/scripts/list-mise-tasks.ts b/.github/workflows/scripts/list-mise-tasks.ts index 278456fc..08911bcc 100644 --- a/.github/workflows/scripts/list-mise-tasks.ts +++ b/.github/workflows/scripts/list-mise-tasks.ts @@ -90,9 +90,6 @@ const tasks: { if (tool?.startsWith("npm")) { tools.push("node"); } - if (tool?.startsWith("ubi")) { - tools.push("ubi"); - } const dependencies = getDependencies(to).map((node) => getNodeLabel(getNodeFromRef(node)), From 3cacac4b341c52445079321ff8914a9d4a9a92d2 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 14 Oct 2024 20:57:30 +0900 Subject: [PATCH 32/33] ci(.github/workflows/scripts/list-mise-tasks.ts): remove backends from installing tools --- .github/workflows/scripts/list-mise-tasks.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/scripts/list-mise-tasks.ts b/.github/workflows/scripts/list-mise-tasks.ts index 08911bcc..af4317db 100644 --- a/.github/workflows/scripts/list-mise-tasks.ts +++ b/.github/workflows/scripts/list-mise-tasks.ts @@ -87,10 +87,6 @@ const tasks: { const tools: string[] = tool ? [tool] : []; - if (tool?.startsWith("npm")) { - tools.push("node"); - } - const dependencies = getDependencies(to).map((node) => getNodeLabel(getNodeFromRef(node)), ); From 78583d386a88da7720f66e6ac0e08da38c678d59 Mon Sep 17 00:00:00 2001 From: risu729 Date: Mon, 14 Oct 2024 20:59:25 +0900 Subject: [PATCH 33/33] Revert "ci(.github/workflows/scripts/list-mise-tasks.ts): remove backends from installing tools" This reverts commit 3cacac4b341c52445079321ff8914a9d4a9a92d2. --- .github/workflows/scripts/list-mise-tasks.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/scripts/list-mise-tasks.ts b/.github/workflows/scripts/list-mise-tasks.ts index af4317db..08911bcc 100644 --- a/.github/workflows/scripts/list-mise-tasks.ts +++ b/.github/workflows/scripts/list-mise-tasks.ts @@ -87,6 +87,10 @@ const tasks: { const tools: string[] = tool ? [tool] : []; + if (tool?.startsWith("npm")) { + tools.push("node"); + } + const dependencies = getDependencies(to).map((node) => getNodeLabel(getNodeFromRef(node)), );