Skip to content

Modify GitHub Actions #21

Modify GitHub Actions

Modify GitHub Actions #21

Workflow file for this run

name: CI for general build
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, ubuntu-20.04, windows-latest, macOS-14 ]
arch: [ x64 ]
include:
- os: windows-latest
arch: x86
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: ${{matrix.arch}}
- name: Config for Windows
if: runner.os == 'Windows'
run: |
if ("${{matrix.arch}}" -eq "x64") {
$msbuildPlatform = "x64"
} else {
$msbuildPlatform = "Win32"
}
cmake -A $msbuildPlatform -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root
- name: Config for Unix
if: runner.os != 'Windows'
run: cmake -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release --target install --parallel 8
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Release --output-on-failure