Skip to content

Commit a0e5a01

Browse files
committed
added ci/cd
1 parent 07155ee commit a0e5a01

File tree

3 files changed

+177
-0
lines changed

3 files changed

+177
-0
lines changed

.github/workflows/cpp-qt-macos.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: MacOS Qt CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
project: 'terrafirma'
11+
12+
jobs:
13+
build:
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
name: [macos-6.4]
19+
include:
20+
- name: macos-6.4
21+
os: macos-latest
22+
qt: '6.4.3'
23+
runs-on: ${{ matrix.os }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Install Qt
29+
uses: jurplel/install-qt-action@v3
30+
with:
31+
version: ${{ matrix.qt }}
32+
target: 'desktop'
33+
cache: 'true'
34+
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt }}
35+
36+
- name: Create BUILD folder
37+
run: |
38+
mkdir ../build
39+
40+
- name: Configure cmake
41+
working-directory: ../build
42+
env:
43+
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}
44+
run: cmake ${{ github.workspace }}
45+
46+
- name: Build (MacOS)
47+
working-directory: ../build
48+
run: make
49+
50+
- name: Deploy Qt (macOS)
51+
working-directory: ../build
52+
run: |
53+
macdeployqt src/${{ env.project }}.app -codesign=- -dmg
54+
55+
- name: Archive build result
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: Binary ${{ matrix.name }}
59+
path: ${{ runner.workspace }}/build/src/${{ env.project }}.dmg
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Ubuntu Qt CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
project: 'terrafirma'
11+
12+
jobs:
13+
build:
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
name: [ubuntu-24.04]
19+
include:
20+
- name: ubuntu-24.04
21+
os: ubuntu-24.04
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install Qt
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install qt6-base-dev qt6-base-dev-tools -y
31+
32+
- name: Create BUILD folder
33+
run: |
34+
mkdir ../build
35+
36+
- name: Configure cmake
37+
working-directory: ../build
38+
env:
39+
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}
40+
run: cmake ${{ github.workspace }}
41+
42+
- name: Build (Ubuntu)
43+
working-directory: ../build
44+
run: make
45+
46+
- name: Archive build result
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: Binary ${{ matrix.name }}
50+
path: ${{ runner.workspace }}/build/src/${{ env.project }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Windows Qt CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
project: 'terrafirma'
11+
12+
jobs:
13+
build:
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
name: [windows-6.4]
19+
include:
20+
- name: windows-6.4
21+
os: windows-2022
22+
qt: '6.4.3'
23+
msvc_toolset: '14.29'
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: ilammy/msvc-dev-cmd@v1
29+
with:
30+
toolset: ${{ matrix.msvc_toolset }}
31+
32+
- name: Install Qt
33+
uses: jurplel/install-qt-action@v3
34+
with:
35+
version: ${{ matrix.qt }}
36+
target: 'desktop'
37+
cache: 'true'
38+
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt }}
39+
40+
- name: Create BUILD folder
41+
run: |
42+
mkdir ../build
43+
mkdir ../deploy
44+
45+
- name: Configure cmake
46+
working-directory: ../build
47+
env:
48+
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}
49+
run: cmake ${{ github.workspace }} -G "NMake Makefiles"
50+
51+
- name: Build (Windows)
52+
working-directory: ../build
53+
shell: cmd
54+
run: nmake
55+
56+
- name: Deploy Qt (Windows)
57+
working-directory: ../build
58+
shell: cmd
59+
run: |
60+
cp ..\build\${{ env.project }}.exe ..\deploy\${{ env.project }}.exe
61+
windeployqt ..\deploy
62+
63+
- name: Archive build result
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: Binary ${{ matrix.name }}
67+
path: ${{ runner.workspace }}/deploy/*
68+

0 commit comments

Comments
 (0)