Skip to content

Commit

Permalink
Add more builds using Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dfandrich committed Jan 7, 2021
1 parent 6232664 commit f6e3ca5
Showing 1 changed file with 197 additions and 10 deletions.
207 changes: 197 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,213 @@ name: Linux CI

on:
# Trigger the workflow on push or pull requests, but only for the
# master and CI branches
# master and ci branches
push:
branches:
- master
- '*/ci'
- ci
pull_request:
branches:
- master

env:
MAKEFLAGS: -j 2

jobs:
build:
runs-on: ubuntu-latest
build-18_04:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
build:
- name: normal
- cc: gcc
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: clang
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++
target: all
install_target: install install-po install-desktop-file
- name: no-nls
cc: gcc
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
ldflags:
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: clang
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++
target: all
install_target: install install-po install-desktop-file
- name: no-nls
cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3
cxx: g++
target: all
install_target: install install-po install-desktop-file
- name: debuglog
cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 -DDEBUG
cxx: g++
target: all
install_target: install install-po install-desktop-file
failing_tests: 16
- cc: clang-8
gtk: 2
make_opts:
install: clang-8 desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++-8
target: all
install_target: install install-po install-desktop-file
- cc: clang-9
gtk: 2
install: clang-9 desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++-9
target: all
install_target: install install-po install-desktop-file
- cc: clang-10
gtk: 2
install: clang-10 desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++-10
target: all
install_target: install install-po install-desktop-file
- name: sanitize
cc: clang-10
gtk: 3
install: clang-10 desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -g -O0 -fsanitize=address -fsanitize=undefined -DENABLE_NLS=1
ldflags: -g -O0 -fsanitize=address -fsanitize=undefined
cxx: clang++-10
target: all
install_target: install install-po install-desktop-file
asan_options: strict_string_checks=0:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1

steps:
- uses: actions/checkout@v2
- name: 'install deps'
run: sudo apt-get install -y ${{ matrix.build.install }}
- name: 'build'
run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }}
- name: 'smoke test'
run: ./gpscorrelate -V
- name: 'test'
run: |
if [[ -z "${{ matrix.build.failing_tests }}" ]] ; then
make check CHECK_OPTIONS=-v ASAN_OPTIONS="${{ matrix.build.asan_options }}"
else
# Debug logging enabled makes some tests fail due to differing output
echo 'Expecting ${{ matrix.build.failing_tests }} test failures'
make check CHECK_OPTIONS=-v | tee /dev/stderr | grep -q '${{ matrix.build.failing_tests }} test(s) have FAILED'
fi
- name: 'install test'
run: make prefix= DESTDIR="${PWD}" ${{ matrix.build.install_target }}

build-20_04:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
build:
- cc: gcc
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: clang
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++
target: all
install_target: install install-po install-desktop-file
- name: no-nls
cc: gcc
gtk: 2
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk2.0-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: g++
target: all
install_target: install install-po install-desktop-file
- cc: clang
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1
cxx: clang++
target: all
install_target: install install-po install-desktop-file
- name: no-nls
cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc
cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3
cxx: g++
target: all
install_target: install install-po install-desktop-file

steps:
- uses: actions/checkout@v2
- name: 'install deps'
run: sudo apt-get install -y ${{ matrix.build.install }}
- name: 'build'
run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }}
- name: 'smoke test'
run: ./gpscorrelate -V
- name: 'test'
run: |
if [[ -z "${{ matrix.build.failing_tests }}" ]] ; then
make check CHECK_OPTIONS=-v ASAN_OPTIONS="${{ matrix.build.asan_options }}"
else
# Debug logging enabled makes some tests fail due to differing output
echo 'Expecting ${{ matrix.build.failing_tests }} test failures'
make check CHECK_OPTIONS=-v | tee /dev/stderr | grep -q '${{ matrix.build.failing_tests }} test(s) have FAILED'
fi
- name: 'install test'
run: make prefix= DESTDIR="${PWD}" ${{ matrix.build.install_target }}

coverage:
runs-on: ubuntu-18.04
strategy:
matrix:
build:
- cc: gcc
gtk: 3
install: desktop-file-utils docbook-xsl exiv2 libexiv2-dev libgtk-3-dev xsltproc lcov
cflags: -g -O0 --coverage
ldflags: -g -O0 --coverage
cxx: g++
target: gpscorrelate

steps:
- uses: actions/checkout@v2
Expand All @@ -42,7 +224,12 @@ jobs:
run: ./gpscorrelate -V

- name: 'test'
run: make check CHECK_OPTIONS=-v
run: make check CHECK_OPTIONS=-v ASAN_OPTIONS="${{ matrix.build.asan_options }}"

- name: 'install test'
run: make prefix= DESTDIR="${HOME}" ${{ matrix.build.target }}
- name: coverage analysis
run: mkdir coverage && lcov -c -d . -o coverage/lcov.info

- name: push to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}

0 comments on commit f6e3ca5

Please sign in to comment.