Compare commits

...

9 Commits

Author SHA1 Message Date
Taiki Endo
a75cc5295d Release 1.15.5 2022-12-13 20:54:41 +09:00
Taiki Endo
ee26d44cfa Update shellcheck@latest to 0.9.0 2022-12-13 20:52:26 +09:00
Taiki Endo
4eef07f07c Release 1.15.4 2022-12-12 23:43:39 +09:00
Taiki Endo
bb72b7ab31 Test GitHub-provided ubuntu-22.04 runner in CI 2022-12-12 23:38:49 +09:00
Taiki Endo
f80dd34cc7 Update cargo-binstall@latest to 0.18.0 2022-12-12 23:26:16 +09:00
Taiki Endo
a252073294 Support installing cargo-binstall on custom linux targets 2022-12-12 23:26:02 +09:00
Taiki Endo
f4a1ca475e Update shfmt@latest to 3.6.0 2022-12-12 23:19:44 +09:00
Taiki Endo
d33a0a9074 Test ubuntu and debian containers in CI 2022-12-11 16:22:13 +09:00
Taiki Endo
3594558506 Test musl container in CI (#31) 2022-12-11 14:21:01 +09:00
4 changed files with 98 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
binstall
bytecodealliance
Dpkg
jfrimmel
koalaman
libc

View File

@@ -10,7 +10,7 @@ on:
- main
- dev
schedule:
- cron: '0 0 * * *'
- cron: '0 1 * * *'
workflow_dispatch:
defaults:
@@ -27,14 +27,17 @@ jobs:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
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,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- cargo-hack@0.5.24,cargo-llvm-cov@0.5.2,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.11,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@3.0.1,mdbook@0.4.22,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
# Nextest supports basic version ranges as well
- nextest@0.9
include:
# Note: Specifying the version of valgrind and cargo-binstall is not supported.
- os: ubuntu-20.04
tool: cargo-hack@0.5.24,cargo-llvm-cov@0.5.2,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.11,shellcheck@0.9.0,shfmt@3.6.0,wasm-pack@0.10.3,wasmtime@3.0.1,mdbook@0.4.22,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
# Nextest supports basic version ranges as well. For other tools, this will be supported by https://github.com/taiki-e/install-action/pull/27.
- os: ubuntu-20.04
tool: nextest@0.9
- os: macos-11
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- os: windows-2019
@@ -47,3 +50,37 @@ jobs:
- uses: ./
with:
tool: ${{ matrix.tool }}
test-container:
strategy:
fail-fast: false
matrix:
include:
- container: ubuntu:20.04
# valgrind: installing snap to container is difficult...
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- container: debian:latest
# valgrind: installing snap to container is difficult...
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- container: alpine:latest
# cargo-udeps,protoc,valgrind,wasmtime,mdbook,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,shellcheck,shfmt,wasm-pack,cargo-binstall
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install requirements (ubuntu/debian)
run: |
set -ex
apt-get -o Acquire::Retries=10 -qq update
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends ca-certificates cargo curl unzip xz-utils
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
- name: Install requirements (alpine)
run: apk add bash cargo curl tar xz
shell: sh
if: startsWith(matrix.container, 'alpine')
- uses: ./
with:
tool: ${{ matrix.tool }}

View File

@@ -10,6 +10,16 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [1.15.5] - 2022-12-13
- Update `shellcheck@latest` to 0.9.0.
## [1.15.4] - 2022-12-12
- Update `shfmt@latest` to 3.6.0.
- Update `cargo-binstall@latest` to 0.18.0.
- Support installing `cargo-binstall` on linux with custom host targets such as x86_64-alpine-linux-musl.
## [1.15.3] - 2022-12-11
- Fix bug regarding musl host detection. ([#29](https://github.com/taiki-e/install-action/issues/29))
@@ -419,7 +429,9 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.15.3...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.15.5...HEAD
[1.15.5]: https://github.com/taiki-e/install-action/compare/v1.15.4...v1.15.5
[1.15.4]: https://github.com/taiki-e/install-action/compare/v1.15.3...v1.15.4
[1.15.3]: https://github.com/taiki-e/install-action/compare/v1.15.2...v1.15.3
[1.15.2]: https://github.com/taiki-e/install-action/compare/v1.15.1...v1.15.2
[1.15.1]: https://github.com/taiki-e/install-action/compare/v1.15.0...v1.15.1

56
main.sh
View File

@@ -80,7 +80,7 @@ host_triple() {
}
install_cargo_binstall() {
# https://github.com/cargo-bins/cargo-binstall/releases
local binstall_version="0.17.0"
local binstall_version="0.18.0"
local install_binstall='1'
if [[ -f "${cargo_bin}/cargo-binstall${exe}" ]]; then
if [[ "$(cargo binstall -V)" == "cargo-binstall ${binstall_version}" ]]; then
@@ -98,14 +98,14 @@ install_cargo_binstall() {
host_triple
base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/v${binstall_version}/cargo-binstall"
case "${host}" in
x86_64-unknown-linux-gnu) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
x86_64-unknown-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
x86_64-*-linux-gnu) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
x86_64-*-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
armv7-unknown-linux-gnueabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
armv7-unknown-linux-musleabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
armv7-*-linux-gnueabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
armv7-*-linux-musleabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
aarch64-unknown-linux-gnu) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
aarch64-unknown-linux-musl) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
aarch64-*-linux-gnu) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
aarch64-*-linux-musl) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
x86_64-pc-windows-gnu) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
@@ -137,6 +137,34 @@ cargo_binstall() {
*) cargo binstall --force --no-confirm --version "${version}" "${tool}" ;;
esac
}
apt_update() {
if type -P sudo &>/dev/null; then
retry sudo apt-get -o Acquire::Retries=10 -qq update
else
retry apt-get -o Acquire::Retries=10 -qq update
fi
}
apt_install() {
if type -P sudo &>/dev/null; then
retry sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends "$@"
else
retry apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends "$@"
fi
}
apt_remove() {
if type -P sudo &>/dev/null; then
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y "$@"
else
apt-get -qq -o Dpkg::Use-Pty=0 remove -y "$@"
fi
}
snap_install() {
if type -P sudo &>/dev/null; then
retry sudo snap install "$@"
else
retry snap install "$@"
fi
}
if [[ $# -gt 0 ]]; then
bail "invalid argument '$1'"
@@ -313,7 +341,7 @@ for tool in "${tools[@]}"; do
esac
miner_patch_version="${version#*.}"
base_url="https://github.com/${repo}/releases/download/v${miner_patch_version}/protoc-${miner_patch_version}"
# Copying files to /usr/local/include requires sudo.
# Copying files to /usr/local/include requires sudo, so do not use it.
bin_dir="${HOME}/.install-action/bin"
include_dir="${HOME}/.install-action/include"
if [[ ! -d "${bin_dir}" ]]; then
@@ -349,7 +377,7 @@ for tool in "${tools[@]}"; do
;;
shellcheck)
# https://github.com/koalaman/shellcheck/releases
latest_version="0.8.0"
latest_version="0.9.0"
repo="koalaman/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
@@ -359,7 +387,7 @@ for tool in "${tools[@]}"; do
case "${OSTYPE}" in
linux*)
if type -P shellcheck &>/dev/null; then
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y shellcheck
apt_remove shellcheck
fi
url="${base_url}.linux.x86_64.tar.xz"
;;
@@ -374,7 +402,7 @@ for tool in "${tools[@]}"; do
;;
shfmt)
# https://github.com/mvdan/sh/releases
latest_version="3.5.1"
latest_version="3.6.0"
repo="mvdan/sh"
case "${version}" in
latest) version="${latest_version}" ;;
@@ -411,12 +439,12 @@ for tool in "${tools[@]}"; do
darwin* | cygwin* | msys*) bail "${tool} for non-linux is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
retry sudo apt-get -o Acquire::Retries=10 -qq update
apt_update
# libc6-dbg is needed to run Valgrind
retry sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y libc6-dbg
apt_install libc6-dbg
# Use snap to install the latest Valgrind
# https://snapcraft.io/install/valgrind/ubuntu
retry sudo snap install valgrind --classic
snap_install valgrind --classic
;;
wasm-pack)
# https://github.com/rustwasm/wasm-pack/releases