File: builds.yml

package info (click to toggle)
lunar-date 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: javascript: 13,172; ansic: 2,414; python: 152; xml: 34; sh: 33; makefile: 6
file content (78 lines) | stat: -rw-r--r-- 2,125 bytes parent folder | download
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
name: CI Build

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:

# cancel already running builds of the same branch or pull request
concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.sha }}
  cancel-in-progress: true

jobs:
  build:
    name: Build on ${{matrix.container}} (using ${{matrix.cc}})
    runs-on: ubuntu-latest
    container:
      image: ${{matrix.container}}
      volumes:
        - /tmp/.cache
        - /var/cache/apt

    strategy:
      fail-fast: false # don't cancel other jobs in the matrix if one fails
      matrix:
        container:
          [
            "debian:testing",
            "fedora:latest",
            "ubuntu:rolling",
            "archlinux:latest",
          ]
        cc: ["gcc"]
        cxx: ["g++"]
        include:
          - container: "archlinux:latest"
            cc: "clang"
            cxx: "clang++"

    env:
      # Speed up build with ccache
      CC: ccache ${{ matrix.cc }}
      CXX: ccache ${{ matrix.cxx }}
      CONTAINER: ${{ matrix.container }}

    steps:
      - name: Setup environment variables
        shell: bash
        run: |
          split=(${CONTAINER//:/ })
          distro=${split[0]}
          short_sha=${SHA:0:8}
          echo "DISTRO=$distro" | tee -a  $GITHUB_ENV
      - name: Install git command
        shell: bash
        run: |
          echo "::group::Install git ..."
          apt-get update -qq && apt-get install --assume-yes git || true
          dnf update -y && dnf install -y git || true
          pacman --noconfirm -Sy git || true
          echo "::endgroup::"
      - name: Repository checkout
        uses: actions/checkout@v6
        with:
          submodules: "true"
      - name: Install dependency packages
        run: .github/workflows/${{ env.DISTRO }}.sh
      - name: Enable ccache to speed up builds
        uses: hendrikmuhs/ccache-action@v1.2
        with:
          key: ${{ env.DISTRO }}-${{ matrix.cc }}

      - name: Build the source code
        run: .github/workflows/builds.sh