summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ghci.yml
blob: bd9b0fb3af2779634c27f00eed2ae7edb40c9243 (plain)
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
name: GitHub CI tests

on:
  push:
    branches: [master, ci, coverity_scan]
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-18.04, macos-10.15]
        cc: [gcc, clang]
        exclude:
          - os: macos-10.15
            cc: gcc
        include:
          # Enable distcheck for one build
          - os: ubuntu-18.04
            cc: gcc
            do_distc: yes

    steps:
      - name: checkout code
        uses: actions/checkout@v2

      - name: retrieve caches
        uses: actions/cache@v2
        with:
          path: |
            $HOME/Library/Caches/Homebrew
            /usr/local/Homebrew
          key: ${{ runner.os }}-${{ matrix.os }}-build

      - name: install deps
        run: |
          if echo "${{ matrix.os }}" | grep -qE '^macos-' ; then
            #brew update
            # fontconfig, freetype, autoconf and libtool are preinstalled
            # and `brew install` fails if a non-uptodate version is already installed
            #brew upgrade fontconfig freetype autoconf libtool
            brew install automake fribidi harfbuzz nasm
          else
            sudo apt-get update #&& sudo apt-get upgrade
            sudo apt-get install -y \
                 libfontconfig1-dev libfreetype6-dev libfribidi-dev \
                 libharfbuzz-dev nasm ${{ matrix.cc }}
          fi

      - name: configure
        run: ./autogen.sh && CC="${{ matrix.cc }}" ./configure

      - name: compile
        run: test "x${{ matrix.do_distc }}" = "xyes" || make -j 2

      - name: distcheck
        run: if [ "x${{ matrix.do_distc }}" = "xyes" ] ; then make -j 2 distcheck; fi