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 35c8739
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 28 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
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"));

0 comments on commit 35c8739

Please sign in to comment.