Files
openmethod/.github/workflows/main.yml
Jean-Louis Leroy 5e0fa8ee4b inception
2025-03-08 15:31:25 -05:00

123 lines
4.1 KiB
YAML

# Copyright (c) 2018-2025 Jean-Louis Leroy
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# CI is quite simple at the moment. It will be improved and made more
# comprehensive, probably similar to Boost.Unordered.
name: CI
env:
BUILD_TYPE: Debug Release
permissions:
contents: 'read'
pages: 'write'
id-token: 'write'
on: [push, pull_request, workflow_dispatch]
jobs:
Ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
compiler: [clang++, g++]
steps:
- uses: actions/checkout@v4
- name: Install clang++
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $1
if: matrix.compiler == 'clang++'
- name: Install Boost
run: sudo apt-get install -y libboost-all-dev
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DBUILD_TESTING=1 -DBUILD_EXAMPLES=1 -Bbuild
- name: Build
run: cmake --build build
- name: Test
run: |
ctest --test-dir build --rerun-failed --output-on-failure
Windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- name: Install boost
uses: MarkusJx/install-boost@v2
id: install-boost
with:
boost_version: 1.87.0
- name: Configure
run: |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_TESTING=1 -DBUILD_EXAMPLES=1 -Bbuild -DBoost_DIR=${{ steps.install-boost.outputs.BOOST_ROOT }} -DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}\include -DBoost_LIBRARY_DIRS=${{steps.install-boost.outputs.BOOST_ROOT}}\lib
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
run: cmake --build build --config ${{ matrix.config }}
- name: Test
run: |
ctest --test-dir build --rerun-failed --output-on-failure -C ${{ matrix.config }}
MacOS:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- name: Install boost
run: brew install boost
- name: Configure
run: |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_TESTING=1 -DBUILD_EXAMPLES=1 -Bbuild
- name: Build
run: |
cmake --build build
- name: Test
run: |
ctest --test-dir build --rerun-failed --output-on-failure
Artifacts:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Install asciidoctor
run: |
sudo apt-get install asciidoctor
asciidoctor doc/openmethod.adoc -o build_outputs_folder/index.html
- name: Generate documentation
run: |
sudo apt-get install asciidoctor
asciidoctor doc/openmethod.adoc -o build_outputs_folder/index.html
- name: Build flat headers
run: |
mkdir -p build_outputs_folder/boost/openmethod
python3 dev/flatten.py \
build_outputs_folder/boost/openmethod.hpp \
include/boost/openmethod.hpp \
include/boost/openmethod/unique_ptr.hpp \
include/boost/openmethod/shared_ptr.hpp \
include/boost/openmethod/compiler.hpp
python3 dev/flatten.py \
build_outputs_folder/boost/openmethod/policies.hpp \
include/boost/openmethod/policies.hpp
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
path: build_outputs_folder/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4