-
Notifications
You must be signed in to change notification settings - Fork 14
75 lines (60 loc) · 2.1 KB
/
ci.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
name: CI
on:
push:
pull_request:
env:
BUILD_TYPE: Release
SCCACHE_GHA_ENABLED: "true"
jobs:
build-mingw:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.7
- name: Install packages
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --no-install-recommends g++-mingw-w64-i686-posix ninja-build wine32 wine
- name: Create build environment
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
working-directory: ${{ github.workspace }}/build
run: |
cmake \
.. \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-ubuntu.cmake \
- name: Build
working-directory: ${{ github.workspace }}/build
run: cmake --build . -j $(nproc)
build-msvc:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.7
- name: Install Ninja
run: choco install ninja
- name: Find Launch-VsDevShell.ps1
run: |
$vs = (Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs).InstallLocation
Write-Output VS_DEV_SHELL=$vs\Common7\Tools\Launch-VsDevShell.ps1 >> $env:GITHUB_ENV
- name: Create build environment
run: cmake -E make_directory ${{ github.workspace }}\build
- name: Configure CMake
working-directory: ${{ github.workspace }}/build
run: |
&$env:VS_DEV_SHELL -HostArch amd64 -Arch x86 -SkipAutomaticLocation
cmake `
.. `
-GNinja `
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
-DCMAKE_BUILD_TYPE="$env:BUILD_TYPE"
- name: Build
working-directory: ${{ github.workspace }}/build
run: |
&$env:VS_DEV_SHELL -HostArch amd64 -Arch x86 -SkipAutomaticLocation
cmake --build . -j $env:NUMBER_OF_PROCESSORS