aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 8d84ba189f64a540f8fc81316bab92cdbbeba0b8 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI

on:
  push:
    branches: [main]
    paths-ignore:
      - "docs/**"
      - "**/README.md"
  pull_request:
    branches: [main]
    paths-ignore:
      - "docs/**"
      - "**/README.md"

jobs:
  macos-build:
    name: macOS Build
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v2

      - name: Restore Cache
        uses: actions/cache@v3
        with:
          path: ~/.cache/vcpkg/archives
          key: vcpkg-${{ runner.os }}

      - name: Setup Ninja
        run: |
          brew install ninja

      - name: Build
        run: |
          cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -S. -Bbuild -G Ninja
          cmake --build build --config Debug --target all

      - name: Test
        working-directory: build
        run: |
          ctest -C Debug -T test --output-on-failure

  windows-build:
    name: Windows Build
    runs-on: windows-latest

    steps:
      - uses: actions/checkout@v2

      - name: Restore Cache
        uses: actions/cache@v3
        with:
          path: ~/AppData/Local/vcpkg/archives
          key: vcpkg-${{ runner.os }}

      - name: Setup Ninja
        run: |
          choco install ninja

      - name: Build
        run: |
          . tools/Use-VC.ps1
          Use-VC
          cmake -DCMAKE_BUILD_TYPE=Debug -S. -Bbuild -G Ninja
          cmake --build build --config Debug --target all

      - name: Test
        working-directory: build
        run: |
          ctest -C Debug -T test --output-on-failure