Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/c-cpp-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: C/C++ CMake CI

on:
push:
pull_request:
branches: [ "master" ]

jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- name: Linux GCC
os: ubuntu-latest
arch: x86_64
target: native
cmake_args: ""
- name: Linux GCC (no SSE2/AVX2)
os: ubuntu-latest
arch: x86_64
target: native
cmake_args: "-DUSE_SSE2=OFF -DUSE_AVX2=OFF"
- name: Linux ARM GCC
os: ubuntu-24.04-arm
arch: aarch64
target: native
cmake_args: ""
- name: Linux ARM GCC (no NEON)
os: ubuntu-24.04-arm
arch: aarch64
target: native
cmake_args: "-DUSE_NEON=OFF"
- name: Windows MinGW
os: windows-latest
arch: x86_64
target: native
cmake_args: ""
- name: Windows cross (MinGW)
os: ubuntu-latest
arch: x86_64
target: windows-cross
cmake_args: ""
- name: macOS ARM Clang
os: macos-latest
arch: arm64
target: native
cmake_args: ""

steps:
- 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: >-
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-ninja

- 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
run: |
test "$(uname -m)" = "${{ matrix.arch }}"
uname -a
c++ --version
cmake --version
if test "${{ matrix.target }}" = "windows-cross"; then
cmake -S . -B build \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DCMAKE_CROSSCOMPILING_EMULATOR=wine \
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
${{ matrix.cmake_args }}
else
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
${{ matrix.cmake_args }}
fi
cmake --build build --parallel 2
if test "${{ matrix.target }}" = "windows-cross"; then
WINEARCH=win64 WINEDEBUG=-all WINEPREFIX="$RUNNER_TEMP/wine" \
ctest --test-dir build --output-on-failure
else
ctest --test-dir build --output-on-failure
fi
cmake --install build --prefix "$RUNNER_TEMP/reflex-install"

- name: Build and test
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
test "$(uname -m)" = "${{ matrix.arch }}"
uname -a
c++ --version
cmake --version
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
${{ matrix.cmake_args }}
cmake --build build --parallel 2
ctest --test-dir build --output-on-failure
cmake --install build --prefix "$RUNNER_TEMP/reflex-install"
123 changes: 112 additions & 11 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,123 @@ 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-latest
arch: x86_64
target: native
configure_args: ""
- name: Linux GCC (no SSE2/AVX2)
os: ubuntu-latest
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-latest
arch: x86_64
target: native
configure_args: ""
- name: Windows cross (MinGW)
os: ubuntu-latest
arch: x86_64
target: windows-cross
configure_args: ""
- name: macOS ARM Clang
os: macos-latest
arch: arm64
target: native
configure_args: ""

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: 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
run: |
test "$(uname -m)" = "${{ matrix.arch }}"
uname -a
c++ --version
autoreconf -i
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 ${{ matrix.configure_args }}
else
./configure ${{ matrix.configure_args }}
fi
make -j2
make -C tests
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'
shell: msys2 {0}
run: |
test "$(uname -m)" = "${{ matrix.arch }}"
uname -a
c++ --version
autoreconf -i
./configure ${{ matrix.configure_args }}
make -j2
make -C tests
./tests/rtest
Loading
Loading