mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-11 07:00:25 +00:00
ci: Test a case that cargo is not available
This commit is contained in:
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -41,11 +41,11 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-22.04
|
||||||
tool: major.minor.patch
|
tool: major.minor.patch
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-22.04
|
||||||
tool: major.minor
|
tool: major.minor
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-22.04
|
||||||
tool: major
|
tool: major
|
||||||
- os: macos-11
|
- os: macos-11
|
||||||
- os: macos-12
|
- os: macos-12
|
||||||
@@ -134,7 +134,7 @@ jobs:
|
|||||||
apk --no-cache add bash cargo
|
apk --no-cache add bash cargo
|
||||||
shell: sh
|
shell: sh
|
||||||
if: startsWith(matrix.container, 'alpine')
|
if: startsWith(matrix.container, 'alpine')
|
||||||
- uses: actions/checkout@v3 # TODO: actions/checkout@v3 requires glibc 2.28+
|
- uses: actions/checkout@v3 # TODO: actions/checkout@v4 requires glibc 2.28+
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
# cross attempts to install rust-src when Cargo.toml is available even if `cross --version`
|
# cross attempts to install rust-src when Cargo.toml is available even if `cross --version`
|
||||||
@@ -146,6 +146,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
tool: ${{ steps.tool-list.outputs.tool }}
|
tool: ${{ steps.tool-list.outputs.tool }}
|
||||||
|
|
||||||
|
test-no-cargo:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
container: ubuntu:22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Generate tool list
|
||||||
|
id: tool-list
|
||||||
|
run: tools/ci/tool-list.sh >>"${GITHUB_OUTPUT}"
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
tool: ${{ steps.tool-list.outputs.tool }}
|
||||||
|
|
||||||
manifest:
|
manifest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ esac
|
|||||||
tools=()
|
tools=()
|
||||||
for manifest in tools/codegen/base/*.json; do
|
for manifest in tools/codegen/base/*.json; do
|
||||||
tool_name=$(basename "${manifest%.*}")
|
tool_name=$(basename "${manifest%.*}")
|
||||||
|
# cross -V requires rustc
|
||||||
|
if [[ "${tool_name}" == "cross" ]] && ! type -P rustc &>/dev/null; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
case "${host_os}" in
|
case "${host_os}" in
|
||||||
linux*)
|
linux*)
|
||||||
for incompat in ${incompat_tools[@]+"${incompat_tools[@]}"}; do
|
for incompat in ${incompat_tools[@]+"${incompat_tools[@]}"}; do
|
||||||
@@ -120,14 +124,17 @@ case "${host_os}" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# cargo-watch/watchexec-cli is supported by cargo-binstall (through quickinstall)
|
# cargo-binstall requires cargo
|
||||||
case "${version}" in
|
if type -P cargo &>/dev/null; then
|
||||||
|
# cargo-watch/watchexec-cli is supported by cargo-binstall (through quickinstall)
|
||||||
|
case "${version}" in
|
||||||
latest) tools+=(cargo-watch watchexec-cli nextest) ;;
|
latest) tools+=(cargo-watch watchexec-cli nextest) ;;
|
||||||
major.minor.patch) tools+=(cargo-watch@8.1.1 watchexec-cli@1.20.5 nextest@0.9.57) ;;
|
major.minor.patch) tools+=(cargo-watch@8.1.1 watchexec-cli@1.20.5 nextest@0.9.57) ;;
|
||||||
major.minor) tools+=(cargo-watch@8.1 watchexec-cli@1.20 nextest@0.9) ;;
|
major.minor) tools+=(cargo-watch@8.1 watchexec-cli@1.20 nextest@0.9) ;;
|
||||||
major) tools+=(cargo-watch@8 watchexec-cli@1) ;;
|
major) tools+=(cargo-watch@8 watchexec-cli@1) ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# sort and dedup
|
# sort and dedup
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user