Skip to content

Commit e7457c3

Browse files
committed
feat: add CMake PR build workflow for status check
1 parent 2f9209f commit e7457c3

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/cmake-pr.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CMake PR Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
# Cache APT packages
17+
- name: Cache APT packages
18+
uses: actions/cache@v4
19+
with:
20+
path: /var/cache/apt/archives
21+
key: ${{ runner.os }}-apt-${{ hashFiles('**/CMakeLists.txt') }}
22+
restore-keys: |
23+
${{ runner.os }}-apt-
24+
25+
# Update & install dependencies
26+
- name: Install dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y ninja-build make gcc g++ cmake libwayland-dev libxkbcommon-dev xorg-dev
30+
31+
# Cache CMake build directory
32+
- name: Cache build
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
build
37+
~/.cache
38+
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}
39+
restore-keys: |
40+
${{ runner.os }}-cmake-
41+
42+
- name: Configure
43+
run: |
44+
cmake -S . -B build -G Ninja \
45+
-DCMAKE_BUILD_TYPE=Release
46+
47+
- name: Build
48+
run: |
49+
cmake --build build

0 commit comments

Comments
 (0)