Skip to content

[ci] Fix that we did call C stuff instead of CXX in CMake #304

[ci] Fix that we did call C stuff instead of CXX in CMake

[ci] Fix that we did call C stuff instead of CXX in CMake #304

Workflow file for this run

name: Build
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
boost: [0, 1]
header_only: [0, 1]
config:
- {
name: "Windows (MSVC)",
os: windows-latest,
cmakeflags: "-DLIBREMIDI_NO_WINUWP=0 -DBOOST_ROOT=$PWD/boost_1_82_0",
test_target: "RUN_TESTS"
}
- {
name: "Ubuntu (gcc)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_FLAGS='-Werror=return-type -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -D_GLIBCXX_ASSERTIONS=1 -D_GLIBCXX_SANITIZE_VECTOR=1'",
test_target: "test"
}
- {
name: "Ubuntu (clang, libstdc++)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-Werror=return-type -fsanitize=address -fsanitize=undefined'",
test_target: "test"
}
- {
name: "Ubuntu (clang, libc++)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -Werror=return-type'",
test_target: "test"
}
- {
name: 'Tarball',
os: ubuntu-latest,
cmakeflags: "",
test_target: "test"
}
- {
name: "macOS",
os: macos-13,
cmakeflags: "-DCMAKE_CXX_FLAGS=-Werror=return-type",
test_target: "test"
}
steps:
- uses: actions/checkout@v3
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: latest-stable
- name: Install dependencies
if: matrix.config.name != 'Tarball'
run: |
git submodule update --init --recursive
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install cmake libboost-dev libasound-dev libjack-jackd2-dev clang libc++-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
curl -L https://github.com/ossia/sdk/releases/download/sdk28/boost_1_82_0.tar.gz > boost.tar.gz
tar -xzf boost.tar.gz
rm boost.tar.gz
else
brew install boost
fi
shell: bash
- name: Configure
if: matrix.config.name != 'Tarball'
shell: bash
run: |
cmake -S . -B build \
${{ matrix.config.cmakeflags }} \
-DLIBREMIDI_FIND_BOOST=${{ matrix.boost }} \
-DLIBREMIDI_HEADER_ONLY=${{ matrix.header_only }} \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install
- name: Build
if: matrix.config.name != 'Tarball'
run: |
cmake --build build --config Debug
cmake --build build --config Debug --target install
- name: Test
if: matrix.config.name != 'Tarball'
run: |
# Not available on GH actions...
# if [ "$RUNNER_OS" == "Linux" ]; then
# sudo modprobe snd-virmidi midi_devs=1
# fi
cmake --build build --config Debug --target ${{ matrix.config.test_target }}
shell: bash
build_bsd:
name: FreeBSD
runs-on: macos-12
strategy:
fail-fast: false
matrix:
boost: [0, 1]
header_only: [0, 1]
steps:
- uses: actions/checkout@v3
- uses: vmactions/freebsd-vm@v0
with:
usesh: true
prepare: |
pkg install -y jackit boost-libs cmake git
run: |
pwd
ls -lah
whoami
env
freebsd-version
cmake -S . -B build \
-DLIBREMIDI_FIND_BOOST=${{ matrix.boost }} \
-DLIBREMIDI_HEADER_ONLY=${{ matrix.header_only }} \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install
cmake --build build
cmake --build build --target install
cmake --build build --target test