CI: add some "basic" GitHub Actions #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
cpp: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: 'Windows static library -- Build and test' | |
os: windows-latest | |
build_shared: OFF | |
unit_tests: ON | |
- name: 'Windows shared library -- Build and test' | |
os: windows-latest | |
build_shared: ON | |
unit_tests: ON | |
- name: 'Linux static library -- Build only' | |
os: ubuntu-latest | |
build_shared: OFF | |
unit_tests: OFF | |
- name: 'Linux shared library -- Build and test' | |
os: ubuntu-latest | |
build_shared: ON | |
unit_tests: ON | |
- name: 'macOS static library (Intel) -- Build and test' | |
os: macos-13 | |
build_shared: OFF | |
unit_tests: ON | |
- name: 'macOS shared library (Intel) -- Build and test' | |
os: macos-13 | |
build_shared: ON | |
unit_tests: ON | |
- name: 'macOS static library (ARM) -- Build and test' | |
os: macos-latest | |
build_shared: OFF | |
unit_tests: ON | |
- name: 'macOS shared library (ARM) -- Build and test' | |
os: macos-latest | |
build_shared: ON | |
unit_tests: ON | |
env: | |
BUILDCACHE_ACCURACY: STRICT | |
BUILDCACHE_COMPRESS_FORMAT: ZSTD | |
BUILDCACHE_DEBUG: -1 | |
BUILDCACHE_LOG_FILE: "" | |
steps: | |
- name: Check out libCellML | |
uses: actions/checkout@v4 | |
- name: Install CMake and Ninja | |
uses: lukka/get-cmake@latest | |
- name: Install buildcache | |
uses: mikehardy/buildcache-action@v2 | |
with: | |
cache_key: ${{ matrix.os }}-${{ matrix.build_shared }} | |
- name: Configure MSVC | |
if: ${{ runner.os == 'Windows' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Configure libCellML | |
run: | | |
mkdir build | |
cd build | |
cmake -G Ninja -DBINDINGS_PYTHON=OFF -DBUILD_SHARED=${{ matrix.build_shared }} -DCOVERAGE=OFF -DLLVM_COVERAGE=OFF -DMEMCHECK=OFF -DUNIT_TESTS=${{ matrix.unit_tests }} .. | |
- name: Build libCellML | |
run: | | |
cd build | |
ninja | |
- name: Unit testing | |
if: ${{ matrix.unit_tests == 'ON' }} | |
run: | | |
cd build | |
ninja test |