diff --git a/.cargo/config.toml b/.cargo/config.toml index 3ffde89b20..73f82bb72b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,2 @@ [env] RUST_TEST_THREADS = '1' - -[target.x86_64-unknown-linux-gnu] -linker = "clang" -rustflags = ["-C", "link-arg=-fuse-ld=mold"] diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 4fe6f28e6e..0c5686adb7 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -21,6 +21,8 @@ env: RUST_BACKTRACE: 1 NPM_CONFIG_FUND: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=mold jobs: autofix: @@ -30,9 +32,6 @@ jobs: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 - with: - shared-key: test-ubuntu-latest - save-if: false - run: | cargo build --all-features echo "$PWD/target/debug" >> "$GITHUB_PATH" diff --git a/.github/workflows/hyperfine.yml b/.github/workflows/hyperfine.yml index 6f4e1d2512..ac8bcf0ffd 100644 --- a/.github/workflows/hyperfine.yml +++ b/.github/workflows/hyperfine.yml @@ -14,6 +14,8 @@ env: CARGO_TERM_COLOR: always GITHUB_TOKEN: ${{ secrets.RTX_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} MISE_EXPERIMENTAL: 1 + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=mold permissions: pull-requests: write @@ -36,7 +38,7 @@ jobs: echo "release=$(mise-release v | awk '{print $1}')" >> "$GITHUB_OUTPUT" - uses: actions/cache@v4 with: - path: $HOME/bin/mise-${{ steps.versions.outputs.main }} + path: ~/bin/mise-${{ steps.versions.outputs.main }} key: mise-hyperfine-main-${{ steps.versions.outputs.main }}-${{ runner.os }} - name: build main run: | diff --git a/.github/workflows/release-fig.yml b/.github/workflows/release-fig.yml index a56552549b..ccb50242d0 100644 --- a/.github/workflows/release-fig.yml +++ b/.github/workflows/release-fig.yml @@ -17,7 +17,7 @@ jobs: - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 with: - shared-key: test-ubuntu-latest + shared-key: build save-if: false - run: mkdir -p "$HOME/bin" && echo "$HOME/bin" >> "$GITHUB_PATH" - run: cargo build --all-features && cp target/debug/mise "$HOME"/bin diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index af8a59232f..2780597708 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -37,11 +37,9 @@ jobs: git_user_signingkey: true git_commit_gpgsign: true git_tag_gpgsign: true - - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 with: - shared-key: test-ubuntu-latest - save-if: false + shared-key: build - run: mkdir -p "$HOME/bin" && echo "$HOME/bin" >> "$GITHUB_PATH" - run: cargo build --all-features && cp target/debug/mise "$HOME"/bin - run: mise install diff --git a/.github/workflows/test-plugins.yml b/.github/workflows/test-plugins.yml index 4f6c79bf4d..8ed2692ab7 100644 --- a/.github/workflows/test-plugins.yml +++ b/.github/workflows/test-plugins.yml @@ -26,12 +26,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: rui314/setup-mold@v1 - name: Rust Cache uses: Swatinem/rust-cache@v2 with: - shared-key: test-ubuntu-latest + shared-key: build save-if: false - - uses: rui314/setup-mold@v1 - run: scripts/build-tarball.sh x86_64-unknown-linux-gnu - uses: actions/upload-artifact@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b3c0f52a4e..5bdfa9e444 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,7 @@ repos: rev: v1.7.4 hooks: - id: actionlint + args: ["-shellcheck", ""] - repo: https://github.com/kykosic/pre-commit-rust rev: 0.4.0 hooks: diff --git a/mise.toml b/mise.toml index 7f1be9c372..67c6ea27d2 100644 --- a/mise.toml +++ b/mise.toml @@ -10,7 +10,7 @@ shfmt = "3" jq = "latest" cargo-binstall = "latest" "cargo:cargo-edit" = "latest" -"cargo:cargo-show" = {version = "latest", os = ["linux", "macos"]} +"cargo:cargo-show" = { version = "latest", os = ["linux", "macos"] } "cargo:cargo-insta" = "latest" "cargo:git-cliff" = "latest" "npm:markdownlint-cli" = "latest" @@ -18,7 +18,7 @@ cargo-binstall = "latest" actionlint = "latest" ripgrep = "latest" "pipx:toml-sort" = "latest" -"cargo:usage-cli" = {version = "1.3", os = ["linux", "macos"]} +"cargo:usage-cli" = { version = "1.3", os = ["linux", "macos"] } bun = "latest" #python = { version = "latest", virtualenv = "{{env.HOME}}/.cache/venv" } diff --git a/tasks/lint-fix b/tasks/lint-fix index d2dcbdb8ba..2f01365f9d 100755 --- a/tasks/lint-fix +++ b/tasks/lint-fix @@ -14,7 +14,7 @@ shfmt -w -i 2 -ci -bn "${scripts_dirs[@]}" prettier -w $(git ls-files '*.yml' '*.yaml') prettier -w . markdownlint --fix . -actionlint +SHELLCHECK_OPTS="--exclude=SC1090" actionlint toml-sort -i settings.toml --spaces-indent-inline-array 4 toml-sort -i registry.toml --spaces-indent-inline-array 4 diff --git a/tasks/lint/actionlint b/tasks/lint/actionlint index fbe333e079..b60ff64b1a 100755 --- a/tasks/lint/actionlint +++ b/tasks/lint/actionlint @@ -1,4 +1,5 @@ #!/usr/bin/env bash set -euo pipefail +export SHELLCHECK_OPTS="--exclude=SC1090" actionlint diff --git a/tasks/test/coverage b/tasks/test/coverage index 2d5bc2eb19..34ff8419b4 100755 --- a/tasks/test/coverage +++ b/tasks/test/coverage @@ -5,41 +5,19 @@ echo "::group::Setup" set -euxo pipefail # shellcheck disable=SC1090 source <(cargo llvm-cov show-env --export-prefix) -cargo llvm-cov clean --workspace if [[ -n ${MISE_GITHUB_BOT_TOKEN:-} ]]; then export GITHUB_API_TOKEN="$MISE_GITHUB_BOT_TOKEN" fi export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$PWD/target}" export PATH="${CARGO_TARGET_DIR}/debug:$PATH" -echo "::group::Build w/ coverage" -cargo build -q --all-features echo "::endgroup::" echo "::group::mise install" mise install mise x -- bun i echo "::endgroup::" -if [[ ${TEST_TRANCHE:-} == 8 ]]; then - cp target/debug/{mise,mise-backup} - echo "::group::Unit tests" - cargo test --all-features - echo "::group::Self update" - # pick a version from the previous month because the current release might not have been published yet - y=$(date +%Y) - m=$(($(date +%m) - 1)) - if [[ $m -eq 0 ]]; then - m=12 - y=$((y - 1)) - fi - mise self-update -fy "$y.$m.0" || true - cp target/debug/{mise-backup,mise} - echo "::group::Implode" - mise implode - cp target/debug/{mise-backup,mise} -else - mise x -- ./e2e/run_all_tests - echo "::group::mist test-tool" - mise test-tool --all -fi +mise x -- ./e2e/run_all_tests +echo "::group::mise test-tool" +mise test-tool --all echo "::group::Render lcov report" cargo llvm-cov report --lcov --output-path "coverage-${TEST_TRANCHE:-}.lcov"