mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
Clean up alias-related code
This commit is contained in:
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -141,6 +141,26 @@ jobs:
|
||||
fi
|
||||
if: matrix.bash != 'cygwin' && matrix.os != 'windows-11-arm'
|
||||
|
||||
test-alias:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: taiki-e/checkout-action@v1
|
||||
# cross attempts to install rust-src when Cargo.toml is available even if `cross --version`
|
||||
- run: rm -- Cargo.toml
|
||||
- run: env
|
||||
- uses: ./
|
||||
with:
|
||||
tool: nextest,taplo-cli
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Test bash
|
||||
run: cargo-nextest nextest --version && taplo --version
|
||||
shell: bash
|
||||
- name: Test sh
|
||||
run: cargo-nextest nextest --version && taplo --version
|
||||
shell: sh
|
||||
|
||||
test-container:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
11
main.sh
11
main.sh
@@ -219,7 +219,7 @@ read_manifest() {
|
||||
if [[ "${rust_crate}" != "null" ]]; then
|
||||
# TODO: don't hardcode tool name and use 'immediate_yank_reflection' field in base manifest.
|
||||
case "${tool}" in
|
||||
cargo-nextest | nextest)
|
||||
cargo-nextest)
|
||||
crate_info=$(curl -v --user-agent "${ACTION_USER_AGENT}" --proto '=https' --tlsv1.2 -fsSL --retry 10 "https://crates.io/api/v1/crates/${rust_crate}" || true)
|
||||
if [[ -n "${crate_info}" ]]; then
|
||||
while true; do
|
||||
@@ -258,7 +258,7 @@ read_manifest() {
|
||||
elif [[ "${host_env}" == "gnu" ]]; then
|
||||
# TODO: don't hardcode tool name and use 'prefer_linux_gnu' field in base manifest.
|
||||
case "${tool}" in
|
||||
cargo-nextest | nextest)
|
||||
cargo-nextest)
|
||||
# TODO: don't hardcode required glibc version
|
||||
required_glibc_version=2.27
|
||||
higher_glibc_version=$(LC_ALL=C sort -Vu <<<"${required_glibc_version}"$'\n'"${host_glibc_version}" | tail -1)
|
||||
@@ -743,10 +743,11 @@ for tool in "${tools[@]}"; do
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
# Handle aliases
|
||||
# Handle aliases.
|
||||
# NB: Update alias list in tools/publish.rs.
|
||||
case "${tool}" in
|
||||
cargo-nextest | nextest) tool=cargo-nextest ;;
|
||||
taplo-cli | taplo) tool=taplo ;;
|
||||
nextest) tool=cargo-nextest ;;
|
||||
taplo-cli) tool=taplo ;;
|
||||
esac
|
||||
|
||||
# Use cargo-binstall fallback if tool is not available.
|
||||
|
||||
@@ -133,9 +133,13 @@ for tool in tools/codegen/base/*.json; do
|
||||
tool="${tool##*/}"
|
||||
tools+=("${tool%.*}")
|
||||
done
|
||||
# Alias
|
||||
tools+=(nextest)
|
||||
# Not manifest-based
|
||||
# Aliases.
|
||||
# NB: Update case for aliases in main.rs.
|
||||
tools+=(
|
||||
nextest
|
||||
taplo-cli
|
||||
)
|
||||
# Non-manifest-based tools.
|
||||
tools+=(valgrind)
|
||||
|
||||
for tool in "${tools[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user