Skip to content

Commit bf0084b

Browse files
committed
Added GitHub CI
1 parent 9290487 commit bf0084b

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed

.github/workflows/ci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: CI (Linux/macOS)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
arch: x86_64
16+
qt_host: linux
17+
qt_arch: linux_gcc_64
18+
pkg_glob: build-Release/*.{deb,rpm,sh,run,zip,tar.gz,tar.xz}
19+
- os: macos-26
20+
arch: arm64
21+
qt_host: mac
22+
qt_arch: clang_64
23+
pkg_glob: build-Release/*.{dmg,pkg,zip,tar.gz,tar.xz}
24+
- os: windows-latest
25+
arch: x64
26+
qt_host: windows
27+
qt_arch: win64_msvc2022_64
28+
pkg_glob: build-Release/*.{msi,exe,zip}
29+
30+
runs-on: ${{ matrix.os }}
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
submodules: recursive
36+
fetch-depth: 0
37+
38+
# Prep
39+
- name: Prep Linux
40+
if: matrix.os == 'ubuntu-latest'
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y ninja-build
44+
45+
- name: Prep macOS
46+
if: startsWith(matrix.os, 'macos-')
47+
run: |
48+
brew update
49+
brew install ninja || true
50+
51+
- name: Set up MSVC (Windows)
52+
if: matrix.os == 'windows-latest'
53+
uses: ilammy/msvc-dev-cmd@v1
54+
55+
- name: Ensure Ninja (Windows)
56+
if: matrix.os == 'windows-latest'
57+
run: choco install ninja -y || echo "Ninja already present"
58+
shell: pwsh
59+
60+
# Qt
61+
- name: Install Qt 6.10.0
62+
uses: jurplel/install-qt-action@v4
63+
with:
64+
version: '6.10.0'
65+
host: ${{ matrix.qt_host }}
66+
target: desktop
67+
arch: ${{ matrix.qt_arch }}
68+
cache: true
69+
aqtversion: '==3.3.*'
70+
modules: 'qthttpserver qtwebsockets qtimageformats'
71+
72+
- name: Show versions (Unix)
73+
if: matrix.os != 'windows-latest'
74+
run: |
75+
cmake --version
76+
qmake -v || true
77+
78+
- name: Show versions (Windows)
79+
if: matrix.os == 'windows-latest'
80+
run: |
81+
cmake --version
82+
qmake -v || Write-Host "qmake not on PATH (ok)"
83+
shell: pwsh
84+
85+
# Configure
86+
- name: Configure (Unix)
87+
if: matrix.os != 'windows-latest'
88+
run: cmake -S src -B build-Release -G Ninja
89+
90+
- name: Configure (Windows)
91+
if: matrix.os == 'windows-latest'
92+
run: cmake -S src -B build-Release -G Ninja
93+
shell: pwsh
94+
95+
# Build
96+
- name: Build (Unix)
97+
if: matrix.os != 'windows-latest'
98+
run: cmake --build build-Release --parallel
99+
100+
- name: Build (Windows)
101+
if: matrix.os == 'windows-latest'
102+
run: cmake --build build-Release --parallel
103+
shell: pwsh
104+
105+
# Package
106+
- name: CPack (Unix)
107+
if: matrix.os != 'windows-latest'
108+
run: cmake --build build-Release --target package --parallel
109+
continue-on-error: true
110+
111+
- name: CPack (Windows)
112+
if: matrix.os == 'windows-latest'
113+
run: cmake --build build-Release --target package --parallel
114+
shell: pwsh
115+
continue-on-error: true
116+
117+
# Artifacts
118+
- name: Upload packages
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: range-cloud-${{ matrix.os }}-${{ matrix.arch }}-packages
122+
path: |
123+
build-Release/*.deb
124+
build-Release/*.rpm
125+
build-Release/*.sh
126+
build-Release/*.run
127+
build-Release/*.zip
128+
build-Release/*.tar.gz
129+
build-Release/*.dmg
130+
build-Release/*.exe
131+
if-no-files-found: error

0 commit comments

Comments
 (0)