Skip to content

Commit

Permalink
test: install clippy for nightly jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 19, 2024
1 parent d587823 commit dbe56d8
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 29 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,23 @@ 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
- run: ./scripts/test-standalone.sh
- 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'
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
50 changes: 29 additions & 21 deletions scripts/render-registry.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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"));
2 changes: 1 addition & 1 deletion src/forge/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Forge for CargoForge {
}

fn get_dependencies(&self, _tvr: &ToolRequest) -> eyre::Result<Vec<ForgeArg>> {
Ok(vec!["cargo".into(), "cargo-binstall".into(), "rust".into()])
Ok(vec!["cargo".into(), "rust".into()])
}

fn _list_remote_versions(&self) -> eyre::Result<Vec<String>> {
Expand Down
1 change: 1 addition & 0 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
];

Expand Down

0 comments on commit dbe56d8

Please sign in to comment.