diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c7397f4..b03bd099 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,15 +27,15 @@ jobs: tool: # Note: Specifying the version of valgrind is not supported. # cargo-watch is supported by cargo-binstall (through quickinstall) - - cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch - - cargo-hack@0.5.17,cargo-llvm-cov@0.4.14,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cargo-udeps@0.1.32,cross@0.2.4,nextest@0.9.11,protoc@3.21.5,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@0.40.0,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1 + - cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch + - cargo-hack@0.5.17,cargo-llvm-cov@0.4.14,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cargo-udeps@0.1.32,cargo-valgrind@2.1.0,cross@0.2.4,nextest@0.9.11,protoc@3.21.5,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@0.40.0,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1 # Nextest supports basic version ranges as well - nextest@0.9 include: - os: macos-11 - tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch + tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch - os: windows-2019 - tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch + tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f212ab..9cd91d45 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 `cargo-valgrind` + ## [1.11.2] - 2022-08-23 - Update `wasmtime@latest` to 0.40.0. diff --git a/README.md b/README.md index 13e97e14..42103532 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ https://spdx.org/licenses | [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [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, Windows | [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) | +| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Release](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) or [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) | | [**wasm-pack**](https://github.com/rustwasm/wasm-pack) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustwasm/wasm-pack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-MIT) | | [**wasmtime**](https://github.com/bytecodealliance/wasmtime) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/bytecodealliance/wasmtime/releases) | Linux, macOS, Windows | [Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/HEAD/LICENSE) | diff --git a/main.sh b/main.sh index fca8e255..1ed2c694 100755 --- a/main.sh +++ b/main.sh @@ -212,6 +212,31 @@ for tool in "${tools[@]}"; do # leading `./` is required for cargo-udeps to work download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}" ;; + cargo-valgrind) + # https://github.com/jfrimmel/cargo-valgrind + latest_version="2.1.0" + repo="jfrimmel/${tool}" + case "${version}" in + latest) version="${latest_version}" ;; + esac + base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-${version}" + case "${OSTYPE}" in + linux*) + target="x86_64-unknown-linux-musl" + url="${base_url}-${target}.tar.gz" + ;; + darwin*) + target="x86_64-apple-darwin" + url="${base_url}-${target}.tar.gz" + ;; + cygwin* | msys*) + target="x86_64-pc-windows-msvc" + url="${base_url}-${target}.zip" + ;; + *) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;; + esac + download "${url}" "${cargo_bin}" "${tool}${exe}" + ;; cross) # https://github.com/cross-rs/cross/releases latest_version="0.2.4" @@ -459,6 +484,7 @@ for tool in "${tools[@]}"; do info "${tool} installed at $(type -P "${bin}")" case "${bin}" in "cargo-udeps${exe}") x cargo udeps --help | head -1 ;; # cargo-udeps v0.1.30 does not support --version option + "cargo-valgrind${exe}") x cargo valgrind --help ;; # cargo-valgrind v2.1.0 does not support --version option cargo-*) x cargo "${tool#cargo-}" --version ;; *) x "${tool}" --version ;; esac diff --git a/tools/publish.sh b/tools/publish.sh index 11ac0816..2c4d3034 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -81,6 +81,7 @@ tools=( cargo-llvm-cov cargo-minimal-versions cargo-udeps + cargo-valgrind parse-changelog cargo-binstall cross