-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (143 loc) · 5.59 KB
/
build_and_test.yml
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Build & test
on:
push:
branches:
- master
tags:
- v**.**
pull_request:
branches:
- master
jobs:
build-test-core:
strategy:
fail-fast: false
matrix:
build_profile: [clang20d, clang20r, gcc20d, gcc20r, msvc20d, msvc20r]
include:
- build_profile: clang20d
conan_preset: clang-20-debug
os: ubuntu-latest
- build_profile: clang20r
conan_preset: clang-20-release
os: ubuntu-latest
- build_profile: gcc20d
conan_preset: gcc-20-debug
os: ubuntu-latest
- build_profile: gcc20r
conan_preset: gcc-20-release
os: ubuntu-latest
- build_profile: msvc20d
conan_preset: msvc-20-debug
os: windows-latest
- build_profile: msvc20r
conan_preset: msvc-20-release
os: windows-latest
name: core-${{ matrix.build_profile }}
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@v4
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- run: pip install conan
- name: Install native compilers
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
sudo update-alternatives --remove-all gcc || true
sudo update-alternatives --remove-all g++ || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17 clang
sudo update-alternatives --remove-all clang || true
sudo update-alternatives --remove-all clang++ || true
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 10 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-17
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: conan-cache-packages-${{ matrix.build_profile }}
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
env:
PR: "${{github.workspace}}/.github/build_profiles/${{matrix.build_profile}}"
run: |
git clone https://github.com/petiaccja/asyncpp-conan.git
conan create ./asyncpp-conan -pr $PR -pr:b $PR --version 0.2.2
cmake -E make_directory "${{github.workspace}}/build"
conan install "${{github.workspace}}" --build="*" -pr $PR -pr:b $PR
conan cache clean
cmake -S "${{github.workspace}}" --preset conan-${{ matrix.conan_preset }}
- name: Build
run: |
cmake --build --preset conan-${{ matrix.conan_preset }}
cmake -E make_directory ${{github.workspace}}/install/SEDManager
cmake --install ${{github.workspace}}/build/${{ matrix.conan_preset }} --prefix '${{github.workspace}}/install/SEDManager'
- name: Test
run: ${{github.workspace}}/build/${{ matrix.conan_preset }}/bin/Test
- name: Upload artifact binary
uses: actions/upload-artifact@v4
with:
name: SEDManager-${{ matrix.build_profile }}
path: '${{github.workspace}}/install/SEDManager'
if-no-files-found: error
build-test-flutter:
strategy:
fail-fast: false
matrix:
flutter_target: [windows, linux]
include:
- flutter_target: linux
os: ubuntu-latest
binary_path: build/linux/x64/release/bundle
core_profile: clang20d
- flutter_target: windows
os: windows-latest
binary_path: build/windows/x64/runner/Release
core_profile: msvc20d
name: flutter-${{ matrix.flutter_target }}
needs: [build-test-core]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.9'
channel: 'stable'
- name: Install native compilers
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install ninja-build
sudo apt install gcc-13 g++-13
sudo apt install libgtk-3-dev
sudo update-alternatives --remove-all gcc || true
sudo update-alternatives --remove-all g++ || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
- name: "Download core"
uses: actions/download-artifact@v4
with:
name: SEDManager-${{ matrix.core_profile }}
path: ${{github.workspace}}/core
- name: "Install GUI Dart dependencies"
working-directory: ${{github.workspace}}/src/SEDManagerGUI
run: flutter pub get
- name: "Test GUI"
working-directory: ${{github.workspace}}/src/SEDManagerGUI
run: flutter test --dart-define=CAPI_LIBRARY_PATH=${{github.workspace}}/core
- name: "Build GUI"
working-directory: ${{github.workspace}}/src/SEDManagerGUI
run: flutter build ${{matrix.flutter_target}} --release
- name: "Upload artifact binary"
uses: actions/upload-artifact@v4
with:
name: SEDManagerGUI-${{matrix.flutter_target}}
path: "${{github.workspace}}/src/SEDManagerGUI/${{matrix.binary_path}}"
if-no-files-found: error