diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79de07eb..a6e4abfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,24 +63,30 @@ jobs: bash: msys64 - os: windows-2022 bash: cygwin + - os: windows-2022 + tool: major.minor.patch + - os: windows-2022 + tool: major.minor + - os: windows-2022 + tool: major runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: - run: | - printf 'C:\msys64\mingw32\bin\n' >>"${GITHUB_PATH}" - printf 'C:\msys64\usr\bin\n' >>"${GITHUB_PATH}" + printf '%s\n' 'C:\msys64\mingw32\bin' >>"${GITHUB_PATH}" + printf '%s\n' 'C:\msys64\usr\bin' >>"${GITHUB_PATH}" if: matrix.bash == 'msys64' - run: | choco install --no-progress --requirechecksums cygwin - printf 'C:\tools\cygwin\bin\n' >>"${GITHUB_PATH}" - printf 'C:\tools\cygwin\usr\bin\n' >>"${GITHUB_PATH}" + printf '%s\n' 'C:\tools\cygwin\bin' >>"${GITHUB_PATH}" + printf '%s\n' 'C:\tools\cygwin\usr\bin' >>"${GITHUB_PATH}" if: matrix.bash == 'cygwin' - 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 - name: Generate tool list id: tool-list - run: tools/ci/tool-list.sh "${{ matrix.tool }}" >>"${GITHUB_OUTPUT}" + run: tools/ci/tool-list.sh "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.bash }}" >>"${GITHUB_OUTPUT}" - run: env - uses: ./ with: diff --git a/action.yml b/action.yml index 7131a39e..7767660c 100644 --- a/action.yml +++ b/action.yml @@ -46,3 +46,11 @@ runs: INPUT_TOOL: ${{ inputs.tool }} INPUT_CHECKSUM: ${{ inputs.checksum }} INPUT_FALLBACK: ${{ inputs.fallback }} + if: runner.os != 'Windows' + - run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" + shell: bash + env: + INPUT_TOOL: ${{ inputs.tool }} + INPUT_CHECKSUM: ${{ inputs.checksum }} + INPUT_FALLBACK: ${{ inputs.fallback }} + if: runner.os == 'Windows' diff --git a/tools/ci/tool-list.sh b/tools/ci/tool-list.sh index eb4f70f4..9540d028 100755 --- a/tools/ci/tool-list.sh +++ b/tools/ci/tool-list.sh @@ -40,6 +40,9 @@ glibc_pre_2_17_incompat=( musl_incompat=( "${glibc_pre_2_17_incompat[@]}" ) +win2019_gnu_incompat=( + cargo-spellcheck +) incompat_tools=() case "${1:-}" in @@ -51,9 +54,11 @@ case "${1:-}" in ;; *) echo "tool=$1" - exit 0 + exit 1 ;; esac +runner="${2:-}" +bash="${3:-}" case "$(uname -s)" in Linux) host_os=linux @@ -92,7 +97,16 @@ case "$(uname -s)" in fi ;; Darwin) host_os=macos ;; - MINGW* | MSYS* | CYGWIN* | Windows_NT) host_os=windows ;; + MINGW* | MSYS* | CYGWIN* | Windows_NT) + host_os=windows + case "${bash}" in + msys64 | cygwin) + if [[ "${runner}" == "windows-2019" ]]; then + incompat_tools+=("${win2019_gnu_incompat[@]}") + fi + ;; + esac + ;; *) bail "unrecognized OS type '$(uname -s)'" ;; esac @@ -104,20 +118,19 @@ for manifest in tools/codegen/base/*.json; do continue fi case "${host_os}" in - linux*) - for incompat in ${incompat_tools[@]+"${incompat_tools[@]}"}; do - if [[ "${incompat}" == "${tool_name}" ]]; then - tool_name='' - break - fi - done - ;; + linux*) ;; *) if [[ "$(jq -r ".platform.x86_64_${host_os}" "${manifest}")" == "null" ]]; then continue fi ;; esac + for incompat in ${incompat_tools[@]+"${incompat_tools[@]}"}; do + if [[ "${incompat}" == "${tool_name}" ]]; then + tool_name='' + break + fi + done if [[ -n "${tool_name}" ]]; then if [[ "${version}" != "latest" ]]; then latest_version=$(jq -r ".latest.version" "manifests/${tool_name}.json")