Skip to content

Hydra

Hydra #96

Workflow file for this run

name: Hydra
on:
schedule:
# Once per day, Monday to Friday
- cron: '0 19 * * 1-5'
push:
branches:
- main
pull_request:
concurrency:
group: hydra-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- os: macos-latest
cc: clang
cxx: clang++
type: static
shell: sh
- os: macos-latest
cc: clang
cxx: clang++
type: shared
shell: sh
- os: macos-latest
cc: gcc-13
cxx: g++-13
type: static
shell: sh
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
shell: sh
- os: ubuntu-latest
cc: gcc
cxx: g++
type: static
shell: sh
- os: ubuntu-latest
cc: clang
cxx: clang++
type: shared
shell: sh
- os: ubuntu-latest
cc: gcc
cxx: g++
type: shared
shell: sh
- os: windows-latest
type: static
shell: pwsh
- os: windows-latest
type: shared
shell: pwsh
- os: windows-latest
type: static
shell: msys2 {0}
- os: windows-latest
type: wsl-2
shell: wsl-bash {0}
defaults:
run:
shell: ${{ matrix.platform.shell }}
runs-on: ${{ matrix.platform.os }}
env:
CC: ${{ matrix.platform.cc }}
CXX: ${{ matrix.platform.cxx }}
steps:
- name: Install dependencies (MSYS2)
uses: msys2/setup-msys2@v2
if: matrix.platform.shell == 'msys2 {0}'
with:
install: cmake make gcc
# See https://github.com/Vampire/setup-wsl
- uses: Vampire/setup-wsl@v5
if: runner.os == 'windows' && matrix.platform.type == 'wsl-2'
with:
distribution: Ubuntu-22.04
additional-packages: cmake build-essential ca-certificates
wsl-version: 2
- uses: actions/checkout@v4
- name: Install dependencies (macOS)
if: runner.os == 'macos'
run: brew bundle
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
- run: cmake --version
- name: Configure (static)
if: matrix.platform.type == 'static' || matrix.platform.type == 'wsl-2'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DSOURCEMETA_HYDRA_TESTS:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
- name: Configure (shared)
if: matrix.platform.type == 'shared'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DSOURCEMETA_HYDRA_TESTS:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
- run: cmake --build ./build --config Release --parallel 4
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_hydra
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_hydra_dev
# Not every CTest version supports the --test-dir option. If such option
# is not recognized, `ctest` will successfully exit finding no tests.
# Better to be sure and `cd` all the time here.
- run: cd ./build && ctest --build-config Release --output-on-failure --parallel