[go: up one dir, main page]

Skip to content

Minor CI workflow improvements and fixes #81

Minor CI workflow improvements and fixes

Minor CI workflow improvements and fixes #81

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request: {}
jobs:
build:
name: Qt ${{ matrix.qt-version }}, ${{ matrix.compiler-type }}
runs-on: ubuntu-latest
strategy:
matrix:
qt-version: ['5.9.2', '5.15.0', '6.2.0']
compiler-type: [gcc, clang]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install common packages
run: sudo apt install build-essential cppcheck tree p7zip
- name: Setup compiler
env:
COMP_TYPE: ${{ matrix.compiler-type }}
run: |
if [[ "${COMP_TYPE}" == "clang" ]]
then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
fi
mkdir build
- name: Setup Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}
host: linux
target: desktop
install-deps: false
archives: icu qtbase
cache: true
setup-python: false
extra: --external 7z
- name: Run Cppcheck
run: cppcheck --enable=all --inconclusive --report-progress --std=c++11 src/
- name: QMake package build
working-directory: build
run: |
qmake ../ QMAKE_CC="${CC}" QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXX="${CXX}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LINK="${CXX}" CONFIG+=release CONFIG+=pkgconfig
make
make INSTALL_ROOT=pkg install
tree -p pkg/
rm -fR *
- name: CMake package build
working-directory: build
run: |
cmake -S ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DGENERATE_PKG_CONFIG=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --clean-first
cmake --install . --prefix pkg/usr/ --strip
tree -p pkg/
rm -fR *
- name: QMake tests
working-directory: build
run: |
qmake ../tests/ QMAKE_CC="${CC}" QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXX="${CXX}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LINK="${CXX}"
make
make check
rm -fR *
- name: CMake tests
working-directory: build
run: |
cmake -S ../tests/
cmake --build . --clean-first
ctest -V
rm -fR *