-
Notifications
You must be signed in to change notification settings - Fork 7
133 lines (110 loc) · 4.53 KB
/
ubuntu-build.yaml
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
##############################################################################
# Copyright 2022-2024 Leon Lynch
#
# This file is licensed under the terms of the LGPL v2.1 license.
# See LICENSE file.
##############################################################################
name: Ubuntu build
on: [push]
env:
TR31_VERSION: 0.6.2
jobs:
build-ubuntu-debug:
strategy:
fail-fast: false
matrix:
include:
- { name: "Ubuntu 20.04", os: ubuntu-20.04, ubuntu_release_name: "focal", deps: "none", build_dukpt_ui: NO }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, ubuntu_release_name: "focal", deps: "tr31/qt", build_dukpt_ui: YES }
- { name: "Ubuntu 22.04", os: ubuntu-22.04, ubuntu_release_name: "jammy", deps: "tr31/qt", build_dukpt_ui: YES }
- { name: "Ubuntu 24.04", os: ubuntu-24.04, ubuntu_release_name: "noble", deps: "tr31/qt", build_dukpt_ui: YES }
name: ${{ matrix.name }} build (static/debug/${{ matrix.deps }})
runs-on: ${{ matrix.os }}
steps:
- name: Install MbedTLS
run: |
sudo apt-get update
sudo apt-get install -y libmbedtls-dev
- name: Install TR-31 release
if: contains(matrix.deps, 'tr31')
run: |
gh release download --repo openemv/tr31 ${{ env.TR31_VERSION }}
unzip tr31-${{ env.TR31_VERSION }}-${{ matrix.os }}.zip
sudo dpkg -i tr31_${{ env.TR31_VERSION }}-0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1_amd64.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo apt-get install -y qtbase5-dev
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- run: git describe --always --dirty
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ contains(matrix.deps, 'tr31') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
build-ubuntu-release:
strategy:
fail-fast: false
matrix:
include:
- { name: "Ubuntu 20.04", os: ubuntu-20.04, ubuntu_release_name: "focal" }
- { name: "Ubuntu 22.04", os: ubuntu-22.04, ubuntu_release_name: "jammy" }
- { name: "Ubuntu 24.04", os: ubuntu-24.04, ubuntu_release_name: "noble" }
name: ${{ matrix.name }} build (release)
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmbedtls-dev doxygen qtbase5-dev
- name: Install TR-31 release
run: |
gh release download --repo openemv/tr31 ${{ env.TR31_VERSION }}
unzip tr31-${{ env.TR31_VERSION }}-${{ matrix.os }}.zip
sudo dpkg -i tr31_${{ env.TR31_VERSION }}-0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1_amd64.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Get version from git tag
run: echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV
- name: Configure CMake
# CPACK_DEBIAN_PACKAGE_RELEASE augments the package version for the
# intended Ubuntu release. The ppa1 component indicates that this is not
# an official Ubuntu package. The release name component indicates that
# this is for the specific Ubuntu release that has that name.
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=YES \
-DBUILD_DOCS=YES \
-DBUILD_DUKPT_UI=YES \
-DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE \
-DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Package
run: cmake --build build --target package
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dukpt-${{ env.GIT_DESCRIBE }}-${{ matrix.os }}
path: build/dukpt_*.deb
if-no-files-found: error