-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (78 loc) · 3.03 KB
/
Copy pathcmake.yml
File metadata and controls
99 lines (78 loc) · 3.03 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CMake Build
on:
pull_request:
branches: [ "main" ]
# release:
# types: [published]
env:
QT_VERSION: '6.6.*'
BUILD_TYPE: 'Release'
SRC_DIR: "${{github.workspace}}/logdoctor"
BUILD_DIR: "${{github.workspace}}/build"
RELEASE_DIR: "${{github.workspace}}/release"
# TAG: ${{ github.event.release.tag_name }}
jobs:
build:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: '${{matrix.config.os}}'
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, arch: gcc_64, exec: LogDoctor }
- { os: windows-latest, arch: win64_msvc2019_64, exec: LogDoctor.exe }
- { os: macos-latest, arch: clang_64, exec: LogDoctor.app }
steps:
- name: Get LogDoctor
uses: actions/checkout@v4
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
target: 'desktop'
arch: '${{matrix.config.arch}}'
version: '${{env.QT_VERSION}}'
modules: 'qtcharts'
archives: 'icu qtbase qttools qttranslations'
tools: 'tools_ifw tools_cmake tools_qtcreator,qt.tools.qtcreator'
install-deps: 'true'
- name: Update GCC (NIX)
if: runner.os == 'Linux'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y g++-13 gcc-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 60 --slave /usr/bin/g++ g++ /usr/bin/g++-13
- name: Get MSVC (WIN)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Append PATHs (WIN)
if: runner.os == 'Windows'
uses: myci-actions/export-env-var-powershell@1
with:
name: PATH
value: $env:PATH;D:/a/LogDoctor/Qt/Tools/QtCreator/bin/jom
- name: Configure CMake (NIX)
if: runner.os != 'Windows'
run: cmake -S ${{env.SRC_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Configure CMake (WIN)
if: runner.os == 'Windows'
run: cmake -S ${{env.SRC_DIR}} -B ${{env.BUILD_DIR}} "-DCMAKE_BUILD_TYPE:STRING=${{env.BUILD_TYPE}}" "-DCMAKE_GENERATOR:STRING=NMake Makefiles JOM" "-DCMAKE_MAKE_PROGRAM:STRING=jom" "-DCMAKE_CXX_COMPILER=cl.exe"
- name: Build
run: cmake --build ${{env.BUILD_DIR}} --target all -j16
- name: Test
working-directory: ${{env.BUILD_DIR}}
run: ctest
- name: Prepare deployment
run: |
mkdir "${{env.RELEASE_DIR}}"
mv "${{env.BUILD_DIR}}/${{matrix.config.exec}}" "${{env.RELEASE_DIR}}/"
# echo "RELEASE_NAME=LogDoctor-${TAG:1}-amd64_${{matrix.config.osname}}" >> $GITHUB_ENV
- name: Deploy
uses: actions/upload-artifact@v4
with:
# name: ${{env.RELEASE_NAME}}
name: 'LogDoctor_${{matrix.config.os}}'
path: ${{env.RELEASE_DIR}}
if-no-files-found: error
compression-level: 9
retention-days: 7