summaryrefslogtreecommitdiff
path: root/.github/workflows/action.yml
blob: 7f347d7322878c4e3a191040118a45f3957b6cf9 (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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: GitHub Actions

on: [push]

jobs:
  build:
    strategy:
      matrix:
        name:
          [
            ubuntu-latest-gcc-autotools,
            ubuntu-latest-clang-autotools,
            ubuntu-latest-gcc-cmake,
            ubuntu-latest-clang-cmake,
            macos-latest-clang-autotools,
            macos-latest-clang-cmake,
            ubuntu-latest-gcc-autotools-64-bit-words,
            ubuntu-latest-clang-autotools-64-bit-words,
            ubuntu-latest-gcc-cmake-64-bit-words,
            ubuntu-latest-clang-cmake-64-bit-words,
            macos-latest-clang-autotools-64-bit-words,
            macos-latest-clang-cmake-64-bit-words
          ]
        include:
          - name: ubuntu-latest-gcc-autotools
            os: ubuntu-latest
            cc: gcc
            cxx: g++
            build-system: autotools
            configure-opts: ''

          - name: ubuntu-latest-clang-autotools
            os: ubuntu-latest
            cc: clang
            cxx: clang++
            build-system: autotools
            configure-opts: ''

          - name: ubuntu-latest-gcc-cmake
            os: ubuntu-latest
            cc: gcc
            cxx: g++
            build-system: cmake
            configure-opts: ''

          - name: ubuntu-latest-clang-cmake
            os: ubuntu-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            configure-opts: ''

          - name: macos-latest-clang-autotools
            os: macos-latest
            cc: clang
            cxx: clang++
            build-system: autotools
            configure-opts: ''

          - name: macos-latest-clang-cmake
            os: macos-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            configure-opts: ''

          - name: ubuntu-latest-gcc-autotools-64-bit-words
            os: ubuntu-latest
            cc: gcc
            cxx: g++
            build-system: autotools
            configure-opts: --enable-64-bit-words

          - name: ubuntu-latest-clang-autotools-64-bit-words
            os: ubuntu-latest
            cc: clang
            cxx: clang++
            build-system: autotools
            configure-opts: --enable-64-bit-words

          - name: ubuntu-latest-gcc-cmake-64-bit-words
            os: ubuntu-latest
            cc: gcc
            cxx: g++
            build-system: cmake
            configure-opts: -DENABLE_64_BIT_WORDS=ON

          - name: ubuntu-latest-clang-cmake-64-bit-words
            os: ubuntu-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            configure-opts: -DENABLE_64_BIT_WORDS=ON

          - name: macos-latest-clang-autotools-64-bit-words
            os: macos-latest
            cc: clang
            cxx: clang++
            build-system: autotools
            configure-opts: --enable-64-bit-words

          - name: macos-latest-clang-cmake-64-bit-words
            os: macos-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            configure-opts: -DENABLE_64_BIT_WORDS=ON

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2

      - name: Install MacOS dependencies
        if: startsWith(matrix.os,'macos')
        run: |
          brew update
          brew install automake pkg-config libogg

      - name: Install Lunux dependencies
        if: startsWith(matrix.os,'ubuntu')
        run: |
          sudo apt-get update
          sudo apt-get install -y libtool-bin libogg-dev doxygen libxml2-utils w3c-sgml-lib

      - name: Build with Autotools
        if: startsWith(matrix.build-system,'autotools')
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
        run: |
          ./autogen.sh
          ./configure ${{ matrix.configure-opts }}
          make
          make check

      - name: Build with CMake
        if: startsWith(matrix.build-system,'cmake')
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
        run: |
          mkdir cmake-build
          cd cmake-build
          cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ${{ matrix.configure-opts }} -DCMAKE_FIND_FRAMEWORK=NEVER
          cmake --build .
          ctest -V