forked from latchset/clevis
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.59 KB
/
build.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
---
name: build
on:
push:
ignore-paths:
- '**.md'
pull_request:
ignore-paths:
- '**.md'
env:
VERSION_TAG: ${{ startsWith(github.event.ref, 'refs/tags/') && github.ref_name || format('21.2.{0}', github.run_number) }}
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ ! matrix.stable }}
strategy:
matrix:
include:
- os: fedora:40
stable: true
asset_name: ${{ github.event.repository.name }}-fedora-40.zip
- os: debian:bookworm
stable: true
asset_name: ${{ github.event.repository.name }}-debian-bookworm.zip
- os: ubuntu:noble
stable: true
asset_name: ${{ github.event.repository.name }}-ubuntu-noble.zip
- os: ubuntu:jammy
stable: true
asset_name: ${{ github.event.repository.name }}-ubuntu-jammy.zip
steps:
- name: Install Git
run: >
bash -exc "case ${DISTRO} in debian:*|ubuntu:*)
apt-get update ; apt-get -y install git
;; *fedora:*|*centos:*) yum -y install git ;; esac ;
git config --global --add safe.directory ${GITHUB_WORKSPACE}"
- uses: actions/checkout@v4
- name: Show OS information
run: |
cat /etc/os-release 2>/dev/null || echo /etc/os-release not available
- name: Install build dependencies
run: bash .github/workflows/install-dependencies
- name: Build clevis
run: >
echo "${VERSION_TAG}" > VERSION.TXT ;
mkdir -p build && cd build ;
export ninja=$(command -v ninja) ;
[ -z "${ninja}" ] && export ninja=$(command -v ninja-build) ;
export CFLAGS="-g -coverage" ;
meson .. || cat meson-logs/meson-log.txt >&2 ;
${ninja}
- name: Run tests
run: |
cd build
if ! meson test ; then
cat meson-logs/testlog.txt >&2
exit -1
fi
- name: Show full test logs
run: cat build/meson-logs/testlog.txt >&2
- name: Build OS package
run: bash .github/workflows/build-package
- name: Upload binaries to release
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /output/packages.zip
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
container:
image: ${{matrix.os}}
env:
DISTRO: ${{matrix.os}}
options: --privileged --device /dev/loop-control
# vim:set ts=2 sw=2 et: