-
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.63 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: cpk
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
architecture:
- x64
name: Cpk ${{ matrix.architecture }} on ${{ matrix.os }}
env:
GH_TOKEN: ${{ SECRETS.GH_TOKEN }}
DISPLAY: :0
steps:
- name: Setup Ninja and CMake (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y \
build-essential cmake ninja-build git
- name: Setup Ninja and CMake (MacOS)
if: runner.os == 'macOS'
run: |
brew update > /dev/null
brew install \
cmake ninja
- name: Download and install Ninja (Windows)
if: runner.os == 'Windows'
run: |
$ninjaUrl = "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip"
Invoke-WebRequest -Uri $ninjaUrl -OutFile ninja-win.zip
Expand-Archive -Path ninja-win.zip -DestinationPath $env:USERPROFILE
$env:Path += ";$env:USERPROFILE"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build CPK
run: |
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="upload"
cmake --build build -j16
cmake --install build
- name: Run Tests
working-directory: build
run: ctest -j8
- uses: actions/upload-artifact@v3
with:
name: cpk-${{ matrix.os }}-${{ matrix.architecture }}
path: upload