-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.64 KB
/
cmake-linux.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
name: Build Linux Client
run-name: Build Linux Client
on:
push:
branches: [ "main" ]
paths:
- 'Wasm-client/src/**'
pull_request:
branches: [ "main" ]
paths:
- 'Wasm-client/src/**'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
# Set up a matrix to run the following 3 configurations:
# 1. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
matrix:
os: [ubuntu-24.04]
build_type: [Release]
c_compiler: [gcc, clang]
include:
- os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-24.04
c_compiler: clang
cpp_compiler: clang++
steps:
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwayland-dev
sudo apt-get install -y libxkbcommon-dev
sudo apt-get install -y xorg-dev
sudo apt-get install -y libssl-dev
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/Wasm-client/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=${{ github.workspace }}/Wasm-client/install" >> "$GITHUB_OUTPUT"
- name: Cache Protobuf build directory
id: cache-protobuf
uses: actions/cache@v4
with:
path: ${{ steps.strings.outputs.build-output-dir }}/src/submodules/protobuf/
key: protobuf-linux-build
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/Wasm-client
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Install
run: cmake --install ${{ steps.strings.outputs.build-output-dir }} --prefix ${{ steps.strings.outputs.install-output-dir }} --component shutter
- uses: actions/upload-artifact@v4
with:
name: ShutterController-linux-x64-${{ matrix.cpp_compiler }}
path: ${{ steps.strings.outputs.install-output-dir }}