Debian Codegraph @

.github/workflows/main.yml

raw
1 # SPDX-FileCopyrightText: 2024 Emil Velikov <[email protected]>
2 # SPDX-FileCopyrightText: 2024 Lucas De Marchi <[email protected]>
3 #
4 # SPDX-License-Identifier: LGPL-2.1-or-later
5
6 name: Build and Test
7
8 on:
9 push:
10 branches: [master, ci-test]
11 pull_request:
12 branches: [master]
13 schedule:
14 - cron: "30 2 * * 0"
15
16 permissions:
17 contents: read
18
19 jobs:
20 build:
21 env:
22 CC: ${{ matrix.compiler }}
23 runs-on: ubuntu-latest
24 strategy:
25 fail-fast: false
26 matrix:
27 compiler: ['clang', 'gcc']
28 container:
29 - 'alpine:latest'
30 - 'archlinux:multilib-devel'
31 - 'debian:unstable'
32 - 'fedora:latest'
33 - 'ubuntu:24.04'
34 include:
35 - container: 'archlinux:multilib-devel'
36 crossfile: 'arch-cross.ini'
37 - container: 'debian:unstable'
38 crossfile: 'debian-cross.ini'
39 - container: 'ubuntu:24.04'
40 crossfile: 'ubuntu-cross.ini'
41
42 container:
43 image: ${{ matrix.container }}
44
45 steps:
46 - name: Sparse checkout the local actions
47 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48 with:
49 sparse-checkout: .github
50
51 - uses: ./.github/actions/setup-alpine
52 if: ${{ startsWith(matrix.container, 'alpine') }}
53 - uses: ./.github/actions/setup-archlinux
54 if: ${{ startsWith(matrix.container, 'archlinux') }}
55 - uses: ./.github/actions/setup-debian
56 if: ${{ startsWith(matrix.container, 'debian') }}
57 - uses: ./.github/actions/setup-fedora
58 if: ${{ startsWith(matrix.container, 'fedora') }}
59 - uses: ./.github/actions/setup-ubuntu
60 if: ${{ startsWith(matrix.container, 'ubuntu') }}
61
62 - name: Checkout the whole project
63 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
64
65 - name: Set the environment
66 run: |
67 # The second checkout above claims to set safe.directory, yet it
68 # doesn't quite work. Perhaps our double/sparse checkout is to blame?
69 git config --global --add safe.directory '*'
70
71 - name: configure
72 run: |
73 meson setup --native-file build-dev.ini build
74
75 - name: build
76 run: meson compile -C build
77
78 - name: install
79 run: meson install -C build --destdir $PWD/inst
80
81 - name: distcheck
82 run: meson dist -C build
83
84 - name: configure (32bit)
85 if: ${{ matrix.crossfile != '' && matrix.compiler != 'clang' }}
86 run: |
87 cp .github/cross-files/${{ matrix.crossfile }} cross.ini
88 unset CC
89 meson setup --native-file build-dev.ini --cross-file cross.ini build32
90
91 - name: build (32bit)
92 if: ${{ matrix.crossfile != '' && matrix.compiler != 'clang' }}
93 run: unset CC && meson compile -C build32