From 92f66cb09d7d654cf9bf2e979e820bdcd6fef0af Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 18 Mar 2022 23:58:35 +0900 Subject: [PATCH] Support nextest --- .github/workflows/ci.yml | 6 +++--- CHANGELOG.md | 2 ++ README.md | 1 + main.sh | 27 +++++++++++++++++++++++---- tools/publish.sh | 1 + 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0be2d0ef..b0fd0ea7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,13 +27,13 @@ jobs: - ubuntu-20.04 tool: # Note: Specifying the version of valgrind and wasm-pack is not supported. - - cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,shellcheck,shfmt,valgrind,wasm-pack,wasmtime + - cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime - cargo-hack@0.5.12,cargo-llvm-cov@0.2.3,cargo-minimal-versions@0.1.3,parse-changelog@0.4.7,cross@0.2.1,shellcheck@0.8.0,shfmt@3.4.3,wasmtime@0.35.1 include: - os: macos-10.15 - tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,shellcheck,shfmt,wasm-pack,wasmtime + tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,wasm-pack,wasmtime - os: windows-2019 - tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross + tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index d462289b..e366bdd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +- Support `nextest`. + ## [1.1.9] - 2022-03-10 - Update `wasmtime@latest` to 0.35.1. diff --git a/README.md b/README.md index 0fcbfc14..a7eb6fb1 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ https://spdx.org/licenses | [**cargo-minimal-versions**](https://github.com/taiki-e/cargo-minimal-versions) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-minimal-versions/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-MIT) | | [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-MIT) | | [**cross**](https://github.com/cross-rs/cross) | `~/.cargo/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-MIT) | +| [**nextest**](https://github.com/nextest-rs/nextest) | `~/.cargo/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) | | [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) | | [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS | [BSD-3-Clause](https://github.com/mvdan/sh/blob/HEAD/LICENSE) | | [**valgrind**](https://valgrind.org) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0-or-later](https://valgrind.org/docs/manual/license.gpl.html) | diff --git a/main.sh b/main.sh index e8f23286..99612b59 100755 --- a/main.sh +++ b/main.sh @@ -77,8 +77,9 @@ for tool in "${tools[@]}"; do latest) version="${latest_version}" ;; esac url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz" + # shellcheck disable=SC2086 retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \ - | tar xzf - -C ~/.cargo/bin + | tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin ;; cross) # https://github.com/cross-rs/cross/releases @@ -94,8 +95,25 @@ for tool in "${tools[@]}"; do latest) version="${latest_version}" ;; esac url="https://github.com/${repo}/releases/download/v${version}/cross-v${version}-${target}.tar.gz" + # shellcheck disable=SC2086 retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \ - | tar xzf - -C ~/.cargo/bin + | tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin + ;; + nextest) + # https://nexte.st/book/pre-built-binaries.html + case "${OSTYPE}" in + linux*) url="https://get.nexte.st/latest/linux" ;; + darwin*) url="https://get.nexte.st/latest/mac" ;; + cygwin* | msys*) url="https://get.nexte.st/latest/windows-tar" ;; + *) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;; + esac + case "${version}" in + latest) ;; + *) warn "specifying the version of ${tool} is not supported yet by this action" ;; + esac + # shellcheck disable=SC2086 + retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \ + | tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin ;; shellcheck) # https://github.com/koalaman/shellcheck/releases @@ -176,15 +194,16 @@ for tool in "${tools[@]}"; do latest) version="${latest_version}" ;; esac url="https://github.com/bytecodealliance/wasmtime/releases/download/v${version}/wasmtime-v${version}-${target}.tar.xz" + # shellcheck disable=SC2086 retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \ - | tar xJf - --strip-components 1 -C ~/.cargo/bin "wasmtime-v${version}-${target}/wasmtime" + | tar xJf - --strip-components 1 -C ${CARGO_HOME:-~/.cargo}/bin "wasmtime-v${version}-${target}/wasmtime" ;; *) bail "unsupported tool '${tool}'" ;; esac info "${tool} installed at $(type -P "${tool}")" case "${tool}" in - cargo-*) x cargo "${tool#cargo-}" --version ;; + cargo-* | nextest) x cargo "${tool#cargo-}" --version ;; *) x "${tool}" --version ;; esac echo diff --git a/tools/publish.sh b/tools/publish.sh index ca4158fe..ef251873 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -78,6 +78,7 @@ tools=( cargo-minimal-versions parse-changelog cross + nextest shellcheck shfmt valgrind