merge revision(s) b0a4e2399b:

CI: mingw: Use the official actions for msys2

	Because ruby/setup-ruby is affected to test result.

Also includes the prerequisite changes from e4b386e090, 90f8199412,
a443cd012a and 4adb6f6969 (Remove Strawberry Perl pkg-config, misc
system & package info, `cmd` as the default shell, set up msys2
environment variables).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nagachikaandClaude Opus 5.5 committed 2026-10-17 13:16:06 +09:00
1 parent 2d4992fc9d
commit 98ec35899b
1 file changed
+80 -33
+80 -33
View File
@@ -37,6 +37,7 @@ jobs:
env:
MSYSTEM: ${{ matrix.msystem }}
MSYS2_ARCH: x86_64
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64
CHOST: 'x86_64-w64-mingw32'
CFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe'
CXXFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe'
@@ -48,9 +49,7 @@ jobs:
matrix:
include:
# To mitigate flakiness of MinGW CI, we test only one runtime that newer MSYS2 uses.
# Ruby 3.2 is the first Windows Ruby to use OpenSSL 3.x
- msystem: 'UCRT64'
baseruby: '3.2'
test_task: 'check'
test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/'
fail-fast: false
@@ -66,40 +65,90 @@ jobs:
)}}
steps:
- name: Set up Ruby & MSYS2
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
- uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0
id: msys2
with:
ruby-version: ${{ matrix.baseruby }}
msystem: ${{ matrix.msystem }}
update: true
install: >-
git
make
ruby
autoconf
${{ env.MINGW_PACKAGE_PREFIX }}-gcc
${{ env.MINGW_PACKAGE_PREFIX }}-ragel
${{ env.MINGW_PACKAGE_PREFIX }}-openssl
${{ env.MINGW_PACKAGE_PREFIX }}-libyaml
${{ env.MINGW_PACKAGE_PREFIX }}-libffi
- name: Install MSYS2 perl
- name: Set up env
id: setup-env
working-directory:
# MSYS2 dropped perl from its base install, and the runner image
# picked that up, so `autoreconf` no longer finds its interpreter.
# https://github.com/actions/runner-images/issues/14562
run: pacman --sync --refresh --needed --noconfirm perl
run: |
$msys2 = ${env:MSYS2_LOCATION}
$msystem = ${env:MSYSTEM}.ToLower()
echo $msys2\usr\bin $msys2\$msystem\bin |
Tee-Object ${env:GITHUB_PATH} -Append -Encoding utf-8
# Use the fast device for the temporary directory.
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
$tmp = ${env:RUNNER_TEMP}
echo HOME=$home TMP=$tmp TEMP=$tmp TMPDIR=$tmp |
Tee-Object ${env:GITHUB_ENV} -Append -Encoding utf-8
shell: pwsh # cmd.exe does not strip spaces before `|`.
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
MSYSTEM: ${{ matrix.msystem }}
- name: Remove Strawberry Perl pkg-config
working-directory:
# `pkg-config.bat` included in Strawberry Perl is written in
# Perl and doesn't work when another msys2 `perl` precede its
# own `perl`.
#
# ```
# Can't find C:\Strawberry\perl\bin\pkg-config.bat on PATH, '.' not in PATH.
# ```
run: |
Get-Command pkg-config.bat | % { ren $_.path ($_.path + "~") }
shell: pwsh
- name: Misc system & package info
working-directory:
run: |
# show where
result=true
for e in gcc.exe ragel.exe make.exe libcrypto-3-x64.dll libssl-3-x64.dll; do
echo ::group::$'\033[93m'$e$'\033[m'
where $e || result=false
echo ::endgroup::
done
# show version
for e in gcc ragel make "openssl version"; do
case "$e" in *" "*) ;; *) e="$e --version";; esac
echo ::group::$'\033[93m'$e$'\033[m'
$e || result=false
echo ::endgroup::
done
# show packages
echo ::group::$'\033[93m'Packages$'\033[m'
pacman -Qs mingw-w64-ucrt-x86_64-* | sed -n "s,local/mingw-w64-ucrt-x86_64-,,p"
echo ::endgroup::
$result
group() { echo ::group::$'\e[94;1m'"$*"$'\e[m'; }
endgroup() { echo ::endgroup::; }
group Path
cygpath -wa / . $(type -p cygpath bash sh)
endgroup
I() {
group $1
run Where type -pa $1 && { [ $# -eq 1 ] || run Version "$@"; } ||
failed+=($1)
endgroup
}
run() { local w m=$1; shift; w="$("$@")" && show "$m" && indent "$w"; }
indent() { [ -z "$1" ] || echo "$1" | /bin/sed '/^$/!s/^/ /'; }
show() { echo $'\e[96m'"$*"$'\e[m'; }
failed=()
I gcc.exe --version
I ragel.exe --version
I make.exe --version
I openssl.exe version
I libcrypto-3-x64.dll
I libssl-3-x64.dll
group Packages
pacman -Qs $MINGW_PACKAGE_PREFIX-* | /bin/sed -n "s,local/$MINGW_PACKAGE_PREFIX-,,p"
endgroup
[ ${#failed[@]} -eq 0 ]
shell: sh
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
@@ -118,6 +167,7 @@ jobs:
run: >
../src/configure --disable-install-doc --prefix=/.
--build=$CHOST --host=$CHOST --target=$CHOST
shell: sh
- name: make all
timeout-minutes: 30
@@ -139,7 +189,6 @@ jobs:
- name: test
timeout-minutes: 30
run: make test
shell: cmd
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-v --tty=no'
@@ -147,7 +196,6 @@ jobs:
- name: test-all
timeout-minutes: 45
shell: cmd
run: |
make ${{ StartsWith(matrix.test_task, 'test/') && matrix.test_task || 'test-all' }}
env:
@@ -162,7 +210,6 @@ jobs:
timeout-minutes: 10
run: |
make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }}
shell: cmd
if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/') }}
- uses: ./src/.github/actions/slack
@@ -174,4 +221,4 @@ jobs:
defaults:
run:
working-directory: build
shell: sh
shell: cmd