diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac7b4a518..2aaa0c2d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,12 +37,11 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: nextest,cargo-deny,cargo-msrv,cargo-machete,usage-cli - - name: Install direnv - run: sudo apt-get update; sudo apt-get install direnv - run: | cargo build --all-features echo "$PWD/target/debug" >> "$GITHUB_PATH" - - run: cargo nextest run --all-features + - run: mise install + - run: mise x -- cargo nextest run --all-features - run: cargo deny check - run: cargo msrv verify - run: cargo machete --with-metadata @@ -50,11 +49,11 @@ jobs: - run: mise settings set experimental true - uses: actions/cache@v4 with: + key: mise-tools-${{ hashFiles('.mise.toml') }} + restore-keys: mise-tools path: | ~/.local/share/mise/installs ~/.local/share/mise/plugins - key: mise-tools-${{ hashFiles('.mise.toml') }} - restore-keys: mise-tools - run: mise install - run: mise run render - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'jdx/mise' @@ -74,11 +73,19 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: { toolchain: nightly, components: rustfmt, rustflags: "" } - - run: sudo apt-get update; sudo apt-get install direnv + with: + { toolchain: nightly, components: "rustfmt, clippy", rustflags: "" } - run: | cargo build --all-features echo "$PWD/target/debug" >> "$GITHUB_PATH" + - uses: actions/cache@v4 + with: + key: mise-tools-${{ hashFiles('.mise.toml') }} + restore-keys: mise-tools + path: | + ~/.local/share/mise/installs + ~/.local/share/mise/plugins + - run: mise install - run: mise run test:shuffle - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'jdx/mise' run: mise run lint-fix && git diff HEAD diff --git a/.mise.toml b/.mise.toml index e5c0fb970..df2b36e0b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -20,6 +20,7 @@ shfmt = "3" "cargo:git-cliff" = "latest" "npm:markdownlint-cli" = "0.38" "npm:prettier" = "3" +direnv = "latest" #python = { version = "latest", virtualenv = "{{env.HOME}}/.cache/venv" } #ruby = "3.1" diff --git a/docs/registry.md b/docs/registry.md index 243efd6e4..c3258ccad 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -85,6 +85,7 @@ editLink: false | calendarsync | [asdf:FeryET/asdf-calendarsync](https://github.com/FeryET/asdf-calendarsync) | | calicoctl | [asdf:TheCubicleJockey/asdf-calicoctl](https://github.com/TheCubicleJockey/asdf-calicoctl) | | camunda-modeler | [asdf:barmac/asdf-camunda-modeler](https://github.com/barmac/asdf-camunda-modeler) | +| cargo-binstall | [cargo:cargo-binstall](https://crates.io/crates/cargo-binstall) | | cargo-make | [asdf:mise-plugins/asdf-cargo-make](https://github.com/mise-plugins/asdf-cargo-make) | | carp | [asdf:susurri/asdf-carp](https://github.com/susurri/asdf-carp) | | carthage | [asdf:younke/asdf-carthage](https://github.com/younke/asdf-carthage) | diff --git a/scripts/render-registry.js b/scripts/render-registry.js index 994f31b13..b19faace9 100755 --- a/scripts/render-registry.js +++ b/scripts/render-registry.js @@ -1,9 +1,9 @@ #!/usr/bin/env node -const {execSync} = require("node:child_process"); -const fs = require('node:fs'); +const { execSync } = require("node:child_process"); +const fs = require("node:fs"); -const stdout = execSync("mise registry", {encoding: "utf-8"}); +const stdout = execSync("mise registry", { encoding: "utf-8" }); // Regular expression to match plugin name and repository URL // e.g.: zprint asdf:carlduevel/asdf-zprint const regex = /^(.+?) +(.+?):(.+?) *$/gm; @@ -13,24 +13,32 @@ let output = ["---\neditLink: false\n---"]; output.push("| Short | Full |\n| ----------- | --------------- |"); while ((match = regex.exec(stdout)) !== null) { - if (match[2] === "asdf") { - let repoUrl = match[3].replace(/\.git$/, ""); - if (!repoUrl.startsWith("http")) { - repoUrl = `https://github.com/${repoUrl}`; - } - output.push(`| ${match[1]} | [${match[2]}:${match[3]}](${repoUrl}) |`); - } else if (match[2] === 'core') { - output.push(`| ${match[1]} | [${match[2]}:${match[3]}](https://mise.jdx.dev/lang/${match[2]}.html) |`); - } else if (match[2] === 'cargo') { - output.push(`| ${match[1]} | [${match[2]}:${match[3]}](https://crates.io/crates/${match[3]}) |`); - } else if (match[2] === 'npm') { - output.push(`| ${match[1]} | [${match[2]}:${match[3]}](https://www.npmjs.com/package/${match[3]}) |`); - } else if (match[2] === 'pipx') { - output.push(`| ${match[1]} | [${match[2]}:${match[3]}](https://pypi.org/project/${match[3]}) |`); - } else { - output.push(`| ${match[1]} | ${match[2]}:${match[3]} |`); + if (match[2] === "asdf") { + let repoUrl = match[3].replace(/\.git$/, ""); + if (!repoUrl.startsWith("http")) { + repoUrl = `https://github.com/${repoUrl}`; } + output.push(`| ${match[1]} | [${match[2]}:${match[3]}](${repoUrl}) |`); + } else if (match[2] === "core") { + output.push( + `| ${match[1]} | [${match[2]}:${match[3]}](https://mise.jdx.dev/lang/${match[2]}.html) |`, + ); + } else if (match[2] === "cargo") { + output.push( + `| ${match[1]} | [${match[2]}:${match[3]}](https://crates.io/crates/${match[3]}) |`, + ); + } else if (match[2] === "npm") { + output.push( + `| ${match[1]} | [${match[2]}:${match[3]}](https://www.npmjs.com/package/${match[3]}) |`, + ); + } else if (match[2] === "pipx") { + output.push( + `| ${match[1]} | [${match[2]}:${match[3]}](https://pypi.org/project/${match[3]}) |`, + ); + } else { + output.push(`| ${match[1]} | ${match[2]}:${match[3]} |`); + } } -output.push(''); +output.push(""); -fs.writeFileSync("docs/registry.md", output.join('\n')); +fs.writeFileSync("docs/registry.md", output.join("\n")); diff --git a/src/forge/cargo.rs b/src/forge/cargo.rs index f74837552..cafc3556f 100644 --- a/src/forge/cargo.rs +++ b/src/forge/cargo.rs @@ -30,7 +30,7 @@ impl Forge for CargoForge { } fn get_dependencies(&self, _tvr: &ToolRequest) -> eyre::Result> { - Ok(vec!["cargo".into(), "cargo-binstall".into(), "rust".into()]) + Ok(vec!["cargo".into(), "rust".into()]) } fn _list_remote_versions(&self) -> eyre::Result> { diff --git a/src/registry.rs b/src/registry.rs index bb8f16a16..00c8ef88b 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -6,6 +6,7 @@ use crate::plugins::core::CORE_PLUGINS; const _REGISTRY: &[(&str, &str)] = &[ ("ubi", "cargo:ubi"), + ("cargo-binstall", "cargo:cargo-binstall"), // ("elixir", "asdf:mise-plugins/mise-elixir"), ];