File: ci.yml

package info (click to toggle)
debugcc 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 392 kB
  • sloc: ansic: 6,693; makefile: 8
file content (88 lines) | stat: -rw-r--r-- 2,199 bytes parent folder | download | duplicates (2)
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
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright (c) 2023 Linaro Ltd.
#
name: "Builds"
on:
  pull_request:
  push:
  schedule:
    # Run periodically to check that it still compiles
    - cron: '13 13 * * 1'
  workflow_dispatch:

jobs:
  job:
    name: Build
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read

    strategy:
      fail-fast: false
      matrix:
        container:
          - debian:testing
          - debian:bookworm
            #- debian:bullseye
            #- debian:buster
          - ubuntu:lunar
          - ubuntu:jammy
            #- ubuntu:focal
            #- ubuntu:bionic
            #- ubuntu:xenial
        target:
          - native
          - aarch64-linux-gnu
          - arm-linux-gnueabihf

    container:
      image: ${{ matrix.container }}

    steps:
      - name: Git checkout
        uses: actions/checkout@v3

      - name: Install meson
        run: |
          apt update
          apt -y install --no-install-recommends meson build-essential

      - name: Install cross-compilers
        if: matrix.target != 'native'
        run: |
          apt -y install gcc-${{ matrix.target }}
          FAMILY=$(echo ${{ matrix.target }} | cut -d- -f 1)
          if [ "${FAMILY}" = "aarch64" ] ; then
            CPU="arm64"
          elif [ "${FAMILY}" = "arm" ] ; then
            CPU="arm"
          else
            echo "Unknown CPU family ${FAMILY}"
            exit 1
          fi
          cat > cross.txt << EOF
          [binaries]
          c = '${{ matrix.target }}-gcc'
          strip = '${{ matrix.target }}-strip'
          pkgconfig = 'pkg-config'
          [host_machine]
          system = 'linux'
          cpu_family = '${FAMILY}'
          cpu = 'arm64'
          endian = 'litle'
          [properties]
          pkg_config_libdir = '/usr/lib/${{ matrix.target }}/pkgconfig'
          EOF
          cat cross.txt

      - name: Build
        run: |
          if [ ${{ matrix.target }} = "native" ] ; then
            meson setup . build --werror
          else
            meson setup --cross-file cross.txt . build --werror
          fi
          ninja -C build
          ninja -C build install