From e8b4eec2f43a8bbe902d23f0d89a735b1b3bd097 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 18 Jul 2026 16:41:18 -0400 Subject: [PATCH 1/3] Test on multiple architectures --- .github/workflows/c-cpp.yml | 77 +++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 701d2c862..1ac1af1cd 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -2,22 +2,77 @@ name: C/C++ CI on: push: - branches: [ "master" ] pull_request: branches: [ "master" ] jobs: build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: Linux GCC + os: ubuntu-24.04 + arch: x86_64 + - name: Windows MinGW + os: windows-2025 + arch: x86_64 + - name: macOS ARM Clang + os: macos-15 + arch: arm64 steps: - - uses: actions/checkout@v3 - - name: Bootstrap autotools - run: autoreconf -i - - name: configure - run: ./configure - - name: make - run: make - - name: make test - run: make test + - name: Configure Windows line endings + if: runner.os == 'Windows' + shell: pwsh + run: git config --global core.autocrlf input + + - uses: actions/checkout@v6 + + - name: Set up MSYS2 + if: runner.os == 'Windows' + uses: msys2/setup-msys2@v2 + with: + msystem: UCRT64 + update: true + install: >- + autoconf + automake + bison + make + mingw-w64-ucrt-x86_64-gcc + + - name: Install macOS build tools + if: runner.os == 'macOS' + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + run: brew install autoconf automake + + - name: Build and test + if: runner.os != 'Windows' + shell: bash + run: | + test "$(uname -m)" = "${{ matrix.arch }}" + uname -a + c++ --version + autoreconf -i + ./configure + make -j2 + make -C tests + ./tests/rtest + + - name: Build and test + if: runner.os == 'Windows' + shell: msys2 {0} + run: | + test "$(uname -m)" = "${{ matrix.arch }}" + uname -a + c++ --version + autoreconf -i + ./configure + make -j2 + make -C tests + ./tests/rtest From cfd5de1b22bff6ef91fff9ebc526e4c48a6e0673 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 18 Jul 2026 17:06:09 -0400 Subject: [PATCH 2/3] Add Linux ARM and windows cross --- .github/workflows/c-cpp.yml | 35 +++++++++++++++++++++++++++++++++-- Makefile.am | 4 ++-- Makefile.in | 4 ++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1ac1af1cd..fa9ea90df 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -17,12 +17,23 @@ jobs: - name: Linux GCC os: ubuntu-24.04 arch: x86_64 + target: native + - name: Linux ARM GCC + os: ubuntu-24.04-arm + arch: aarch64 + target: native - name: Windows MinGW os: windows-2025 arch: x86_64 + target: native + - name: Windows cross (MinGW) + os: ubuntu-24.04 + arch: x86_64 + target: windows-cross - name: macOS ARM Clang os: macos-15 arch: arm64 + target: native steps: - name: Configure Windows line endings @@ -51,6 +62,12 @@ jobs: HOMEBREW_NO_AUTO_UPDATE: 1 run: brew install autoconf automake + - name: Install Windows cross tools + if: matrix.target == 'windows-cross' + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends --yes mingw-w64 wine + - name: Build and test if: runner.os != 'Windows' shell: bash @@ -59,10 +76,24 @@ jobs: uname -a c++ --version autoreconf -i - ./configure + if test "${{ matrix.target }}" = "windows-cross"; then + CC=x86_64-w64-mingw32-gcc \ + CXX=x86_64-w64-mingw32-g++ \ + AR=x86_64-w64-mingw32-ar \ + RANLIB=x86_64-w64-mingw32-ranlib \ + LDFLAGS="-static -static-libgcc -static-libstdc++" \ + ./configure --host=x86_64-w64-mingw32 + else + ./configure + fi make -j2 make -C tests - ./tests/rtest + if test "${{ matrix.target }}" = "windows-cross"; then + WINEARCH=win64 WINEDEBUG=-all WINEPREFIX="$RUNNER_TEMP/wine" \ + wine ./tests/rtest.exe + else + ./tests/rtest + fi - name: Build and test if: runner.os == 'Windows' diff --git a/Makefile.am b/Makefile.am index 87c260d86..6aeb062c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ all-local: cp2bin .PHONY: cp2bin # to copy the reflex binary to reflex/bin -cp2bin: $(top_builddir)/src/reflex +cp2bin: $(top_builddir)/src/reflex$(EXEEXT) -mkdir -p $(top_builddir)/bin -cp -f $< $(top_builddir)/bin @echo @@ -50,5 +50,5 @@ install-data-hook: .PHONY: test -test: $(top_builddir)/src/reflex +test: $(top_builddir)/src/reflex$(EXEEXT) -cd tests; $(MAKE) && ./rtest diff --git a/Makefile.in b/Makefile.in index ef0c6cd0b..32e7236a7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -931,7 +931,7 @@ all-local: cp2bin .PHONY: cp2bin # to copy the reflex binary to reflex/bin -cp2bin: $(top_builddir)/src/reflex +cp2bin: $(top_builddir)/src/reflex$(EXEEXT) -mkdir -p $(top_builddir)/bin -cp -f $< $(top_builddir)/bin @echo @@ -965,7 +965,7 @@ install-data-hook: .PHONY: test -test: $(top_builddir)/src/reflex +test: $(top_builddir)/src/reflex$(EXEEXT) -cd tests; $(MAKE) && ./rtest # Tell versions [3.59,3.63) of GNU make to not export all variables. From 88ca947e76c3b0a2aee9af5fb7542a8d78b48aad Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 18 Jul 2026 18:26:06 -0400 Subject: [PATCH 3/3] Add 'no NEON' and 'no SSE2/AVX2' tests --- .github/workflows/c-cpp.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index fa9ea90df..292625827 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -18,22 +18,37 @@ jobs: os: ubuntu-24.04 arch: x86_64 target: native + configure_args: "" + - name: Linux GCC (no SSE2/AVX2) + os: ubuntu-24.04 + arch: x86_64 + target: native + configure_args: --disable-sse2 --disable-avx2 - name: Linux ARM GCC os: ubuntu-24.04-arm arch: aarch64 target: native + configure_args: "" + - name: Linux ARM GCC (no NEON) + os: ubuntu-24.04-arm + arch: aarch64 + target: native + configure_args: --disable-neon - name: Windows MinGW os: windows-2025 arch: x86_64 target: native + configure_args: "" - name: Windows cross (MinGW) os: ubuntu-24.04 arch: x86_64 target: windows-cross + configure_args: "" - name: macOS ARM Clang os: macos-15 arch: arm64 target: native + configure_args: "" steps: - name: Configure Windows line endings @@ -82,9 +97,9 @@ jobs: AR=x86_64-w64-mingw32-ar \ RANLIB=x86_64-w64-mingw32-ranlib \ LDFLAGS="-static -static-libgcc -static-libstdc++" \ - ./configure --host=x86_64-w64-mingw32 + ./configure --host=x86_64-w64-mingw32 ${{ matrix.configure_args }} else - ./configure + ./configure ${{ matrix.configure_args }} fi make -j2 make -C tests @@ -103,7 +118,7 @@ jobs: uname -a c++ --version autoreconf -i - ./configure + ./configure ${{ matrix.configure_args }} make -j2 make -C tests ./tests/rtest