Repository navigation
147 lines (143 loc) · 5.23 KB
/
Copy pathtextscope-build.yml
File metadata and controls
147 lines (143 loc) · 5.23 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: TextScope build and test
on:
workflow_dispatch:
workflow_call:
inputs:
source-ref:
description: Immutable source revision to build
type: string
default: ""
release-tag:
description: Validated release tag; enables standalone packaging when set
type: string
default: ""
permissions:
contents: read
jobs:
source:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.source-ref || github.sha }}
- name: Prepare source and public recipes
run: |
cmake -P packaging/PrepareSource.cmake
cmake -P packaging/PrepareRecipes.cmake
- uses: actions/upload-artifact@v4
with:
name: textscope-source-recipes
path: build/releases/
if-no-files-found: error
unix:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.source-ref || github.sha }}
- name: Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ninja-build libpcre2-dev libgl1-mesa-dev libxkbcommon-x11-0 libxcb-cursor0
- uses: jurplel/install-qt-action@v4
if: runner.os == 'Linux'
with:
version: "6.8.3"
modules: "qt5compat"
cache: true
- name: macOS dependencies
if: runner.os == 'macOS'
run: brew install qt pcre2 ninja pkg-config
- name: Configure
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
cmake -S . -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DTEXTSCOPE_BUILD_EXAMPLE_PLUGIN=ON -DTEXTSCOPE_INSTALL_EXAMPLE_PLUGIN=OFF \
-DTEXTSCOPE_BUILD_PERFORMANCE_TESTS=OFF -DTEXTSCOPE_BUILD_BENCHMARKS=OFF \
-DCMAKE_PREFIX_PATH="$QT_ROOT_DIR"
else
cmake -S . -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DTEXTSCOPE_BUILD_EXAMPLE_PLUGIN=ON -DTEXTSCOPE_INSTALL_EXAMPLE_PLUGIN=OFF \
-DTEXTSCOPE_BUILD_PERFORMANCE_TESTS=OFF -DTEXTSCOPE_BUILD_BENCHMARKS=OFF
fi
- name: Build
run: cmake --build build/release
- name: Test
run: ctest --test-dir build/release --output-on-failure
- name: Preserve failed test diagnostics
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: textscope-test-logs-${{ matrix.os }}
path: |
build/release/test-results/
build/release/Testing/Temporary/
- name: Package standalone application
if: inputs.release-tag != ''
env:
RELEASE_TAG: ${{ inputs.release-tag }}
run: |
cpack --config build/release/CPackConfig.cmake -B build/releases/standalone \
-D "CPACK_PACKAGE_FILE_NAME=${RELEASE_TAG}-${RUNNER_OS}-${RUNNER_ARCH}"
- uses: actions/upload-artifact@v4
if: inputs.release-tag != ''
with:
name: textscope-standalone-${{ matrix.os }}
path: |
build/releases/standalone/*.dmg*
build/releases/standalone/*.tar.gz*
if-no-files-found: error
msys2:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.source-ref || github.sha }}
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
base-devel git mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-qt6-base
mingw-w64-ucrt-x86_64-qt6-5compat mingw-w64-ucrt-x86_64-pcre2
- name: Build and test UCRT64 application
shell: msys2 {0}
run: |
set -euo pipefail
cmake -S . -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=g++ -DTEXTSCOPE_BUNDLE_RUNTIME=ON \
-DTEXTSCOPE_BUILD_TESTS=ON -DTEXTSCOPE_BUILD_EXAMPLE_PLUGIN=ON \
-DTEXTSCOPE_INSTALL_EXAMPLE_PLUGIN=OFF \
-DTEXTSCOPE_BUILD_PERFORMANCE_TESTS=OFF -DTEXTSCOPE_BUILD_BENCHMARKS=OFF
cmake --build build/release
ctest --test-dir build/release --output-on-failure
- name: Build standalone UCRT64 ZIP
if: inputs.release-tag != ''
shell: msys2 {0}
env:
RELEASE_TAG: ${{ inputs.release-tag }}
run: |
cpack --config build/release/CPackConfig.cmake \
-B build/releases/standalone -D "CPACK_PACKAGE_FILE_NAME=${RELEASE_TAG}-Windows-UCRT64-X64"
- uses: actions/upload-artifact@v4
if: inputs.release-tag != ''
with:
name: textscope-standalone-ucrt64
path: build/releases/standalone/*.zip*
if-no-files-found: error
- name: Preserve failed test diagnostics
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: textscope-test-logs-msys2
path: |
build/release/test-results/
build/release/Testing/Temporary/