Skip to content

Commit 737cb72

Browse files
authored
Create cmake-multi-platform.yml
1 parent 2cb1221 commit 737cb72

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CMake on Arch Linux
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
include:
16+
- c_compiler: gcc
17+
cxx_compiler: g++
18+
- c_compiler: clang
19+
cxx_compiler: clang++
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Cache pacman packages
26+
id: cache-pacman
27+
uses: actions/cache@v3
28+
with:
29+
path: /var/cache/pacman/pkg
30+
key: ${{ runner.os }}-pacman-${{ hashFiles('**/PKGBUILD') }}
31+
restore-keys: |
32+
${{ runner.os }}-pacman-
33+
34+
- name: Run build inside Arch Linux container
35+
run: |
36+
docker run --rm \
37+
-v ${{ github.workspace }}:/workspace \
38+
-w /workspace \
39+
archlinux:latest \
40+
bash -c "
41+
pacman -Sy --noconfirm && \
42+
pacman -S --noconfirm base-devel cmake ninja git gtk4 gtk4-layer-shell webkitgtk-6.0 json-c libwebsockets sdbus-cpp qt6 qt-webengine layer-shell-qt || true && \
43+
cmake -B build -G Ninja \
44+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
45+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
46+
-DCMAKE_BUILD_TYPE=Release \
47+
-S . && \
48+
cmake --build build && \
49+
ctest --test-dir build
50+
"

0 commit comments

Comments
 (0)