Remove deprecated symbols: plugindata.h (PR #3072)
[geany-mirror.git] / .github / workflows / build.yml
blob02afbf2cee26c05beca8a5d9ac81b8f63e79696b
2 # Copyright:    2021, The Geany contributors
3 # License:              GNU GPL v2 or later
5 name: CI Build
7 on:
8   push:
9     branches:
10       - master
11   pull_request:
12     branches:
13       - master
15 # cancel already running builds of the same branch or pull request
16 concurrency:
17   group: ci-${{ github.head_ref }} || concat(${{ github.ref }}
18   cancel-in-progress: true
20 env:
21   CFLAGS: -g -O2 -Werror=pointer-arith -Werror=implicit-function-declaration
22   CCACHE_DIR: ${{ github.workspace }}/.ccache
23   CCACHE_COMPRESS: true
24   CCACHE_MAXSIZE: 1G
25   PYTHON: python3
26   DEBUG: 0
28 jobs:
29   linux:
30     name: Linux Build (BINRELOC=${{ matrix.binreloc }})
31     runs-on: ubuntu-18.04
33     strategy:
34       fail-fast: false
35       matrix:
36         include:
37           - binreloc: no
38           - binreloc: yes
40     env:
41       CONFIGURE_FLAGS: --enable-binreloc=${{ matrix.binreloc }}
42       CC: ccache gcc
43       CXX: ccache g++
45     steps:
46       - uses: actions/checkout@v2
48       # create and use a timestamp for the cache key: GH Actions will never update a cache
49       # only use an existing cache item or create a new one. To use an existing cache *and*
50       # push back the the updated cache after build, we use a always new cache key (to force
51       # the creation of the cache item at the end) in combination with "restore-keys" as fallback
52       - name: Prepare ccache timestamp
53         id: ccache_cache_timestamp
54         run: echo "::set-output name=timestamp::$(date +%Y-%m-%d-%H-%M)"
56       - name: Configure ccache
57         uses: actions/cache@v2
58         with:
59           path: ${{ env.CCACHE_DIR }}
60           key: ${{ runner.os }}-${{ github.job }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
61           restore-keys: ${{ runner.os }}-${{ github.job }}-ccache-
63       - name: Show environment
64         run: env | sort
65         if: ${{ env.DEBUG == '1' }}
67       - name: Install dependencies
68         run: |
69           sudo apt-get update -qq
70           sudo apt-get install --assume-yes --no-install-recommends \
71             ccache \
72             gettext autopoint \
73             libtool \
74             libgtk-3-dev \
75             doxygen \
76             python3-docutils \
77             python3-lxml \
78             rst2pdf
80       - name: Configure
81         run: |
82           NOCONFIGURE=1 ./autogen.sh
83           mkdir _build
84           cd _build
85           { ../configure $CONFIGURE_FLAGS || { cat config.log; exit 1; } ; }
87       - name: Build
88         run: |
89           cd _build
90           make
92       - name: Run Tests
93         run: |
94           cd _build
95           make -j2 check
97       - name: Run distcheck
98         run: |
99           cd _build
100           make -j2 distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS";
102       - name: ccache statistics
103         run: ccache --show-stats
104         if: ${{ env.DEBUG == '1' }}
105   linux-meson:
106     name: Linux Meson Build
107     runs-on: ubuntu-20.04
109     strategy:
110       fail-fast: false
112     env:
113       CC: ccache gcc
114       CXX: ccache g++
116     steps:
117       - uses: actions/checkout@v2
119       # create and use a timestamp for the cache key: GH Actions will never update a cache
120       # only use an existing cache item or create a new one. To use an existing cache *and*
121       # push back the the updated cache after build, we use a always new cache key (to force
122       # the creation of the cache item at the end) in combination with "restore-keys" as fallback
123       - name: Prepare ccache timestamp
124         id: ccache_cache_timestamp
125         run: echo "::set-output name=timestamp::$(date +%Y-%m-%d-%H-%M)"
127       - name: Configure ccache
128         uses: actions/cache@v2
129         with:
130           path: ${{ env.CCACHE_DIR }}
131           key: ${{ runner.os }}-${{ github.job }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
132           restore-keys: ${{ runner.os }}-${{ github.job }}-ccache-
134       - name: Show environment
135         run: env | sort
136         if: ${{ env.DEBUG == '1' }}
138       - name: Install dependencies
139         run: |
140           sudo apt-get update -qq
141           sudo apt-get install --assume-yes --no-install-recommends \
142             ccache \
143             gettext autopoint \
144             libtool \
145             libgtk-3-dev \
146             doxygen \
147             python3-docutils \
148             python3-lxml \
149             rst2pdf \
150             meson
152       - name: Configuration
153         run: |
154           meson _build
156       - name: Build
157         run: |
158           ninja -C _build
160       - name: Run Tests
161         run: |
162           ninja -C _build test
164       # distcheck not applicable, meson exports the source tree per git-archive
166       - name: ccache statistics
167         run: ccache --show-stats
168         if: ${{ env.DEBUG == '1' }}
170   mingw:
171     name: Mingw Build
172     # i686-w64-mingw32-pkg-config fails with weird error message on 20.04
173     runs-on: ubuntu-18.04
174     env:
175       CC: ccache i686-w64-mingw32-gcc
176       CXX: ccache i686-w64-mingw32-g++
178     steps:
179       - uses: actions/checkout@v2
181       # create and use a timestamp for the cache key: GH Actions will never update a cache
182       # only use an existing cache item or create a new one. To use an existing cache *and*
183       # push back the the updated cache after build, we use a always new cache key (to force
184       # the creation of the cache item at the end) in combination with "restore-keys" as fallback
185       - name: Prepare ccache timestamp
186         id: ccache_cache_timestamp
187         run: echo "::set-output name=timestamp::$(date +%Y-%m-%d-%H-%M)"
189       - name: Configure ccache
190         uses: actions/cache@v2
191         with:
192           path: ${{ env.CCACHE_DIR }}
193           key: ${{ runner.os }}-${{ github.job }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
194           restore-keys: ${{ runner.os }}-${{ github.job }}-ccache-
196       - name: Show environment
197         run: env | sort
198         if: ${{ env.DEBUG == '1' }}
200       - name: Install dependencies
201         run: |
202           sudo apt-get update -qq
203           sudo apt-get install --assume-yes --no-install-recommends \
204             ccache \
205             gettext autopoint \
206             libtool \
207             mingw-w64-tools \
208             g++-mingw-w64-i686 \
209             gcc-mingw-w64-i686 \
210             binutils-mingw-w64-i686 \
211             doxygen \
212             python3-docutils \
213             python3-lxml \
214             rst2pdf
215           # fix broken pkg-config-crosswrapper, see https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/1327242
216           sudo sed -e 's/PKG_CONFIG_PATH=/&$PKG_CONFIG_PATH:/' -i /usr/bin/i686-w64-mingw32-pkg-config
218       - name: Run autogen.sh
219         run: |
220           NOCONFIGURE=1 ./autogen.sh
222       - name: Build
223         run: |
224           sh ./scripts/cross-build-mingw.sh;
226       - name: ccache statistics
227         run: ccache --show-stats
228         if: ${{ env.DEBUG == '1' }}