CI-unixish.yml: split workflow into parallel jobs (#4417)

This commit is contained in:
Oliver Stöneberg 2022-09-02 15:56:17 +02:00 committed by GitHub
parent cf52ee098a
commit b7e5b702a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 240 additions and 90 deletions

View File

@ -111,3 +111,10 @@ jobs:
run: | run: |
./cppcheck --addon=threadsafety addons/test/threadsafety ./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
- name: Generate Qt help file on ubuntu 18.04
if: false # matrix.os == 'ubuntu-18.04'
run: |
pushd gui/help
qcollectiongenerator online-help.qhcp -o online-help.qhc

View File

@ -8,7 +8,7 @@ permissions:
contents: read contents: read
jobs: jobs:
build: build_cmake_tinyxml2:
strategy: strategy:
matrix: matrix:
@ -24,25 +24,13 @@ jobs:
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libxml2-utils sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
sudo apt-get install libtinyxml2-dev
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# packages for strict cfg checks
- name: Install missing software on ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install libcairo2-dev libcurl4-openssl-dev liblua5.3-dev libssl-dev libsqlite3-dev libcppunit-dev libsigc++-2.0-dev libgtk-3-dev libboost-all-dev libwxgtk3.0-gtk3-dev xmlstarlet
# coreutils contains "nproc"
- name: Install missing software on macos - name: Install missing software on macos
if: contains(matrix.os, 'macos') if: contains(matrix.os, 'macos')
run: | run: |
brew install coreutils python3 qt@5 brew install coreutils qt@5
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
- name: CMake build on ubuntu (with GUI / system tinyxml2) - name: CMake build on ubuntu (with GUI / system tinyxml2)
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
@ -58,6 +46,30 @@ jobs:
run: | run: |
cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc) cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc)
build_cmake:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5
- name: CMake build on ubuntu (with GUI) - name: CMake build on ubuntu (with GUI)
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
run: | run: |
@ -83,32 +95,211 @@ jobs:
pushd cmake.output pushd cmake.output
ctest -j$(nproc) ctest -j$(nproc)
build_uchar:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
- name: Build with Unsigned char - name: Build with Unsigned char
run: | run: |
make clean
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
- name: Test with Unsigned char - name: Test with Unsigned char
run: | run: |
./testrunner TestSymbolDatabase ./testrunner TestSymbolDatabase
build_mathlib:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
- name: Build with TEST_MATHLIB_VALUE - name: Build with TEST_MATHLIB_VALUE
run: | run: |
make clean
touch lib/mathlib.cpp test/testmathlib.cpp
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
- name: Test with TEST_MATHLIB_VALUE - name: Test with TEST_MATHLIB_VALUE
run: | run: |
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
check_nonneg:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# coreutils contains "g++" and "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
# TODO: can we use c++ instead?
- name: Check syntax with NONNEG - name: Check syntax with NONNEG
run: | run: |
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
build_qmake:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5
- name: Build GUI on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pushd gui
qmake CONFIG+=debug HAVE_QCHART=yes
make -j$(nproc)
- name: Run GUI tests on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pushd gui/test/cppchecklibrarydata
qmake CONFIG+=debug
make -j$(nproc)
./test-cppchecklibrarydata
popd
pushd gui/test/filelist
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-filelist
popd
pushd gui/test/projectfile
qmake CONFIG+=debug
make -j$(nproc)
./test-projectfile
popd
pushd gui/test/translationhandler
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-translationhandler
popd
pushd gui/test/xmlreportv2
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-xmlreportv2
- name: Generate Qt help file on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pushd gui/help
qhelpgenerator online-help.qhcp -o online-help.qhc
- name: Build triage on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pushd tools/triage
qmake CONFIG+=debug
make -j$(nproc)
build_fuzz:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build Fuzzer
if: contains(matrix.os, 'ubuntu')
run: |
pushd oss-fuzz
make -j$(nproc) CXX=clang++ CXXFLAGS="-fsanitize=address" fuzz-client translate
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
# packages for strict cfg checks
- name: Install missing software on ubuntu 22.04 (cfg)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install libcairo2-dev libcurl4-openssl-dev liblua5.3-dev libssl-dev libsqlite3-dev libcppunit-dev libsigc++-2.0-dev libgtk-3-dev libboost-all-dev libwxgtk3.0-gtk3-dev xmlstarlet qtbase5-dev
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils python3
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
- name: Build cppcheck - name: Build cppcheck
run: | run: |
make clean
make -j$(nproc) HAVE_RULES=yes make -j$(nproc) HAVE_RULES=yes
- name: Build test - name: Build test
@ -194,81 +385,33 @@ jobs:
- name: Ensure misra addon does not crash - name: Ensure misra addon does not crash
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
run: | run: |
./cppcheck --addon=misra addons/test/misra/crash1.c | ( ! grep 'Bailing out from checking' ) ./cppcheck --addon=misra addons/test/misra/crash1.c | ( ! grep 'Bailing out from checking' )
- name: Build GUI on ubuntu selfcheck:
if: contains(matrix.os, 'ubuntu') needs: build # wait for all tests to be successful first
runs-on: ubuntu-22.04 # run on the latest image only
steps:
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev
- name: Self check (build)
run: |
# compile with verification and ast matchers
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
- name: Generate UI files
run: | run: |
pushd gui pushd gui
qmake CONFIG+=debug HAVE_QCHART=yes qmake CONFIG+=debug HAVE_QCHART=yes
make -j$(nproc) make -j$(nproc) compiler_uic_make_all mocables
- name: Run GUI tests on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pushd gui/test/cppchecklibrarydata
qmake CONFIG+=debug
make -j$(nproc)
./test-cppchecklibrarydata
popd
pushd gui/test/filelist
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-filelist
popd
pushd gui/test/projectfile
qmake CONFIG+=debug
make -j$(nproc)
./test-projectfile
popd
pushd gui/test/translationhandler
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-translationhandler
popd
pushd gui/test/xmlreportv2
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-xmlreportv2
- name: Generate Qt help file on ubuntu 18.04
if: matrix.os == 'ubuntu-18.04'
run: |
pushd gui/help
qcollectiongenerator online-help.qhcp -o online-help.qhc
- name: Generate Qt help file on ubuntu 20.04
if: matrix.os == 'ubuntu-22.04'
run: |
pushd gui/help
qhelpgenerator online-help.qhcp -o online-help.qhc
- name: Build triage on ubuntu
if: matrix.os == 'ubuntu-22.04'
run: |
pushd tools/triage
qmake CONFIG+=debug
make -j$(nproc)
- name: Build Fuzzer
if: matrix.os == 'ubuntu-22.04'
run: |
pushd oss-fuzz
make -j$(nproc) CXX=clang++ CXXFLAGS="-fsanitize=address" fuzz-client translate
- name: Self check (build)
if: matrix.os == 'ubuntu-22.04'
run: |
# compile with verification and ast matchers
make clean
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
# Run self check after "Build GUI" to include generated headers in analysis
- name: Self check - name: Self check
if: matrix.os == 'ubuntu-22.04'
run: | run: |
ec=0 ec=0
# self check lib/cli # self check lib/cli