-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (79 loc) · 2.5 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
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
84
85
86
87
88
89
90
91
92
name: build
on:
workflow_dispatch:
# push:
# branches: [main]
# pull_request:
# branches: [main]
jobs:
job:
name: ${{ matrix.os }} / ${{ matrix.preset }} / ${{ matrix.config }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python: ["3.10"]
config: [Debug, Release]
include:
- os: windows-latest
preset: windows-msvc
cmake: tools/host/cmake/bin/cmake.exe
- os: ubuntu-latest
preset: linux-gcc
cmake: tools/host/cmake/bin/cmake
- os: macos-latest
preset: macos-arm64-clang
cmake: tools/host/cmake/CMake.app/Contents/bin/cmake
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Setup Python.
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
# Install Python packages.
- name: Install Python packages
run: |
python -m pip install -r tools/buildrequirements.txt
python -m pip install pytest-github-actions-annotate-failures
# Install MSVC.
- name: Install MSVC
uses: ilammy/msvc-dev-cmd@v1
# Setup for Windows.
- name: Setup (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
shell: cmd
run: |
setup.bat
# Setup for Linux.
- name: Setup (Linux)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
shell: bash
run: |
./setup.sh
sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
# Setup for macOS.
- name: Setup (macOS)
if: ${{ startsWith(matrix.os, 'macos') }}
shell: bash
run: |
./setup.sh
# Setup vcpkg caching.
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Configure.
- name: Configure
run: ${{matrix.cmake}} --preset ${{matrix.preset}}
# Build.
- name: Build
run: ${{matrix.cmake}} --build build/${{matrix.preset}}