xo-umbrella2/.github/workflows/main-stock-ubuntu.yml

70 lines
2 KiB
YAML

name: build on ubuntu base platform
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize CMake build type here
BUILD_TYPE: Release
jobs:
build:
# This build won't be entirely reproducible, given ubuntu changes on github runners may
# introduce regressions.
#
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v4
- name: idInstall cmake+git
run: |
sudo apt update
echo "::group::cmake install"
sudo apt install -y cmake
echo "::group::git install"
sudo apt install -y git
- name: build+install catch2
run: |
echo "::group::clone catch2"
git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout v3.4.0
echo "::group::catch2 configure"
mkdir .build
cmake -B .build -S .
echo "::group::catch2 install"
sudo cmake --build .build --target install
# this should be sufficient for find_package(Catch2) to work
- name: bootstrap xo-cmake
run: |
PREFIX=${{github.workspace}}/local
mkdir -p ${PREFIX}
echo "::group::xo-cmake configure"
cmake -B .build0 -S xo-cmake -DCMAKE_INSTALL_PREFIX=${PREFIX}
echo "::group::xo-cmake build"
cmake --build .build0
echo "::group::xo-cmake install"
cmake --install .build0
- name: build xo subprojects
run: |
PREFIX=${{github.workspace}}/local
PATH=${{github.workspace}}/local/bin:${PATH}
echo "::group::xo configure"
cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_MODULE_PATH=/usr/local/lib --verbose
echo "::group::xo build"
cmake --build .build
echo "::group::xo install"
cmake --install .build
- name: print install path
run: |
tree ${{github.workspace}}/local