-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.95 KB
/
build.yml
File metadata and controls
83 lines (70 loc) · 2.95 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build
on: [push]
jobs:
build:
runs-on: ${{matrix.platform.os}}
strategy:
fail-fast: false
matrix:
platform:
- { os: windows-2025, cc: cl.exe, cxx: cl.exe}
- { os: ubuntu-24.04, cc: gcc-14, cxx: g++-14, mono: mono }
- { os: ubuntu-24.04, cc: clang-18, cxx: clang++-18, mono: mono }
# - { os: macos-15, cc: clang, cxx: clang++, mono: mono }
build_type: [Release, Debug]
env:
SOURCE_DIR: ${{github.workspace}}
BUILD_DIR: ${{github.workspace}}/build
# CMake will choose a compiler using these environment variables.
CC: ${{matrix.platform.cc}}
CXX: ${{matrix.platform.cxx}}
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# Some vcpkg projects require Mono, and vcpkg seems unable to fetch it
# anymore, so install it manually if running Linux or Mac.
- name: Install Mono (Ubuntu)
if: ${{ matrix.platform.os == 'ubuntu-24.04' }}
run: sudo apt update && sudo apt install mono-complete
- name: Install Mono (macOS)
if: ${{ matrix.platform.os == 'macos-15' }}
run: brew install mono
- name: Bootstrap vcpkg (Windows)
if: ${{ matrix.platform.os == 'windows-2025' }}
run: ./vcpkg/bootstrap-vcpkg
- name: Bootstrap vcpkg (Ubuntu/MacOS)
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'macos-15' }}
run: ./vcpkg/bootstrap-vcpkg.sh
# This step assumes `vcpkg` has been bootstrapped (run `./vcpkg/bootstrap-vcpkg`)
- name: 'Setup NuGet Credentials'
shell: 'bash'
run: >
${{ matrix.platform.mono }} `vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/dholmes215/index.json"
-storepasswordincleartext
-name "GitHub"
-username "dholmes215"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Create Build Environment
# We'll use this as our working directory for all subsequent commands.
run: cmake -E make_directory ${{env.BUILD_DIR}}
- 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
working-directory: ${{env.BUILD_DIR}}
run: cmake -S $SOURCE_DIR -B $BUILD_DIR -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DWARNINGS_AS_ERRORS=ON
- name: Build
working-directory: ${{env.BUILD_DIR}}
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>".
run: cmake --build . --config ${{matrix.build_type}}
- name: Test
working-directory: ${{env.BUILD_DIR}}
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.build_type }}