Skip to content

Fix documentation build and complete API documentation coverage (#632) #3404

Fix documentation build and complete API documentation coverage (#632)

Fix documentation build and complete API documentation coverage (#632) #3404

Workflow file for this run

name: macOS
on:
push:
branches: [ master ]
pull_request:
# create:
# tags:
# - v*
# Cancel a run that has been superseded by a newer push to the same branch. Runs on master are
# never cancelled so that the documentation deployment always completes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build-test:
name: Build and Test macOS
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# cmake/hal_cmake_tools.cmake derives the HAL version through 'git describe --tags',
# so the full history including tags is required
fetch-depth: 0
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache Homebrew Downloads
uses: actions/cache@v4
with:
path: ~/Library/Caches/Homebrew
# key: ${{ runner.OS }}-build-downloads-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.OS }}-build-downloads
restore-keys: |
${{ runner.OS }}-build-downloads-${{ env.cache-name }}-
${{ runner.OS }}-build-downloads-
# - name: Cache Homebrew
# if: matrix.os == 'macOS-latest'
# uses: actions/cache@v4
# with:
# path: /usr/local/Homebrew
# # key: ${{ runner.OS }}-build-localbrew-${{ hashFiles('**/package-lock.json') }}
# key: ${{ runner.OS }}-build-localbrew
# restore-keys: |
# ${{ runner.OS }}-build-localbrew-${{ env.cache-name }}-
# ${{ runner.OS }}-build-localbrew-
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: bash
run: echo "timestamp=$(date -u +'%Y-%m-%d-%H-%M-%S')" >> "$GITHUB_OUTPUT"
- name: ccache cache files
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/.ccache
key: ${{ runner.OS }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.OS }}-ccache-
- name: Install Dependencies
run: ./install_dependencies.sh
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# brew link --force qt@5
run: |
mkdir -p build
cd build
export PATH="$(brew --prefix qt@5)/bin:$PATH"
export LDFLAGS="-L$(brew --prefix qt@5)/lib -Wl,-rpath,$(brew --prefix llvm)/lib"
cmake -G Ninja .. -DQt5_DIR="$(brew --prefix qt@5)/lib/cmake" -DCMAKE_BUILD_TYPE=Debug -DBUILD_ALL_PLUGINS=ON -DBUILD_TESTS=ON -DPL_GUI=ON
env:
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- name: Build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
export PATH="$(brew --prefix qt@5)/bin:$PATH"
export BUILD_TYPE=Debug
export LDFLAGS="-L$(brew --prefix qt@5)/lib -Wl,-rpath,$(brew --prefix llvm)/lib"
export SDKROOT=$(xcrun --show-sdk-path)
cmake --build . --target all --clean-first --config $BUILD_TYPE
env:
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1
- name: Test
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd build
export LDFLAGS="-L$(brew --prefix qt@5)/lib -Wl,-rpath,$(brew --prefix llvm)/lib"
ctest --rerun-failed --output-on-failure
# ninja -v hal_coverage
# bash <(curl -s https://codecov.io/bash) -f hal_coverage.info.cleaned || echo "Codecov did not collect coverage reports"
env:
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M