-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (48 loc) · 2.21 KB
/
ci.yml
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
name: CI
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:rolling
strategy:
fail-fast: false
matrix:
include:
- { qt: 5, cxx: g++, features: '' }
- { qt: 5, cxx: clang++, features: '' }
- { qt: 5, cxx: clang++, features: 'nosound' }
- { qt: 5, cxx: clang++, features: 'nonls' }
- { qt: 6, cxx: g++, features: '' }
- { qt: 6, cxx: clang++, features: '' }
- { qt: 6, cxx: clang++, features: 'nosound' }
- { qt: 6, cxx: clang++, features: 'nonls' }
name: "Qt${{ matrix.qt }}, ${{ matrix.cxx }}, ${{ matrix.features }}"
steps:
- uses: actions/checkout@v3
- name: Set up environment
run: |
apt-get -yqq update && apt-get install -yqq curl python3
curl -s https://raw.githubusercontent.com/AMDmi3/github_env/0.0.1/github_env.py > e; chmod 755 e
./e 'CXX=${{ matrix.cxx }}'
./e 'CXXFLAGS=-Werror -Wall -Wextra -pedantic'
./e --if ${{ matrix.qt != 6 }} 'CMAKE_ARGS=-DUSE_QT6=OFF'
./e 'DEBIAN_FRONTEND=noninteractive'
./e 'DEPENDS=build-essential clang cmake cppcheck'
./e 'DEPENDS+=libsdl2-mixer-dev appstream-util'
./e --if ${{ matrix.qt == 5 }} 'DEPENDS+=qtbase5-dev qttools5-dev qtmultimedia5-dev'
./e --if ${{ matrix.qt == 6 }} 'DEPENDS+=qt6-base-dev qt6-tools-dev qt6-multimedia-dev'
./e --if ${{ contains(matrix.features, 'nosound') }} 'CMAKE_ARGS+=-DENABLE_SOUND:BOOL=FALSE'
./e --if ${{ contains(matrix.features, 'nonls') }} 'CMAKE_ARGS+=-DENABLE_NLS:BOOL=FALSE'
- name: Install dependencies
run: apt-get install -yqq --no-install-recommends $DEPENDS
- name: Run cppcheck
run: cppcheck --std=c++17 --quiet --enable=all src # XXX: not fatal yet, add --error-exitcode
- name: Validate appstream file
run: appstream-util validate-relax --nonet menu/*.metainfo.xml
- name: Configure
run: cmake . -DCMAKE_VERBOSE_MAKEFILE=yes -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS
- name: Build
run: cmake --build .
- name: Install
run: cmake --install .