-
Notifications
You must be signed in to change notification settings - Fork 12
103 lines (82 loc) · 2.96 KB
/
fedora-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
##############################################################################
# Copyright 2022-2024 Leon Lynch
#
# This file is licensed under the terms of the LGPL v2.1 license.
# See LICENSE file.
##############################################################################
name: Fedora build
on: [push]
jobs:
build-fedora-debug:
strategy:
fail-fast: false
matrix:
include:
- { name: "Fedora 40", fedora_version: 40 }
- { name: "Fedora 41", fedora_version: 41 }
name: ${{ matrix.name }} build (static/debug)
runs-on: ubuntu-latest
container: fedora:${{ matrix.fedora_version }}
steps:
- name: Install dependencies
run: |
sudo dnf -y install git cmake gcc mbedtls-devel
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Container user doesn't match runner user
# Github has only fixed https://github.com/actions/checkout/issues/760
# not https://github.com/actions/checkout/issues/766
- name: Configure Git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git describe --always --dirty
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug"
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
build-fedora-release:
strategy:
fail-fast: false
matrix:
include:
- { name: "Fedora 40", fedora_version: 40 }
- { name: "Fedora 41", fedora_version: 41 }
name: ${{ matrix.name }} release
runs-on: ubuntu-latest
container: fedora:${{ matrix.fedora_version }}
steps:
- name: Install dependencies
run: |
sudo dnf -y install git cmake gcc mbedtls-devel bash-completion doxygen rpm-build
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
# Container user doesn't match runner user
# Github has only fixed https://github.com/actions/checkout/issues/760
# not https://github.com/actions/checkout/issues/766
- name: Configure Git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git describe --always --dirty
- name: Get version from git tag
run: echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
- 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: tr31-${{ env.GIT_DESCRIBE }}-fedora${{ matrix.fedora_version }}
path: build/tr31-*.rpm
if-no-files-found: error