forked from danmar/cppcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "release-windows.yml: fixed collecting files [skip ci] (danmar…
- Loading branch information
Showing
21 changed files
with
2,650 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | ||
name: CI-cygwin | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'releases/**' | ||
- '2.*' | ||
tags: | ||
- '2.*' | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: cmd | ||
|
||
jobs: | ||
build_cygwin: | ||
strategy: | ||
matrix: | ||
os: [windows-2022] | ||
arch: [x64] | ||
include: | ||
- platform: 'x86_64' | ||
packages: | | ||
gcc-g++ | ||
python3 | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Cygwin | ||
uses: cygwin/cygwin-install-action@master | ||
with: | ||
platform: ${{ matrix.arch }} | ||
packages: ${{ matrix.packages }} | ||
|
||
# Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries. | ||
- name: Build all and run test | ||
run: | | ||
C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j2 check | ||
- name: Extra test for misra | ||
run: | | ||
cd %GITHUB_WORKSPACE%\addons\test | ||
..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 | ||
python3 ..\misra.py -verify misra\misra-test.c.dump | ||
..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | ||
name: CI-mingw | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'releases/**' | ||
- '2.*' | ||
tags: | ||
- '2.*' | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
||
jobs: | ||
build_mingw: | ||
strategy: | ||
matrix: | ||
# the MinGW installation in windows-2019 is supposed to be 8.1 but it is 12.2 | ||
# the MinGW installation in windows-2022 is not including all necessary packages by default, so just use the older image instead - package versions are he same | ||
os: [windows-2019] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up MSYS2 | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
release: false # use pre-installed | ||
install: >- | ||
mingw-w64-x86_64-lld | ||
mingw-w64-x86_64-ccache | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} | ||
|
||
# TODO: bail out on warning | ||
- name: Build cppcheck | ||
run: | | ||
export PATH="/mingw64/lib/ccache/bin:$PATH" | ||
# set RDYNAMIC to work around broken MinGW detection | ||
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck | ||
env: | ||
LDFLAGS: -fuse-ld=lld # use lld for faster linking | ||
|
||
- name: Build test | ||
run: | | ||
export PATH="/mingw64/lib/ccache/bin:$PATH" | ||
# set RDYNAMIC to work around broken MinGW detection | ||
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner | ||
env: | ||
LDFLAGS: -fuse-ld=lld # use lld for faster linking | ||
|
||
- name: Run test | ||
run: | | ||
export PATH="/mingw64/lib/ccache/bin:$PATH" | ||
# set RDYNAMIC to work around broken MinGW detection | ||
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check | ||
env: | ||
LDFLAGS: -fuse-ld=lld # use lld for faster linking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | ||
name: CI-unixish-docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'releases/**' | ||
- '2.*' | ||
tags: | ||
- '2.*' | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
|
||
jobs: | ||
build_cmake: | ||
|
||
strategy: | ||
matrix: | ||
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04", "ubuntu:24.10"] | ||
include: | ||
- build_gui: false | ||
- image: "ubuntu:24.04" | ||
build_gui: true | ||
- image: "ubuntu:24.10" | ||
build_gui: true | ||
fail-fast: false # Prefer quick result | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
# TODO: is this actually applied to the guest? | ||
env: | ||
# TODO: figure out why there are cache misses with PCH enabled | ||
CCACHE_SLOPPINESS: pch_defines,time_macros | ||
|
||
container: | ||
image: ${{ matrix.image }} | ||
|
||
steps: | ||
# we need to stay at v3 for now because Node 20 does not support the older distros | ||
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node) | ||
- uses: actions/checkout@v3 | ||
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' | ||
|
||
- uses: actions/checkout@v4 | ||
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' | ||
|
||
- name: Install missing software on ubuntu | ||
if: contains(matrix.image, 'ubuntu') | ||
run: | | ||
apt-get update | ||
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev | ||
- name: Install missing software (gui) on latest ubuntu | ||
if: matrix.build_gui | ||
run: | | ||
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev | ||
# needs to be called after the package installation since | ||
# - it doesn't call "apt-get update" | ||
# | ||
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178. | ||
# using the older version will cause a two minute hang in its post-run step. | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' | ||
with: | ||
key: ${{ github.workflow }}-${{ matrix.image }} | ||
|
||
# needs to be called after the package installation since | ||
# - it doesn't call "apt-get update" | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' | ||
with: | ||
key: ${{ github.workflow }}-${{ matrix.image }} | ||
|
||
# tests require CMake 3.9 - ccache available | ||
- name: CMake build (no tests) | ||
if: matrix.image == 'ubuntu:16.04' | ||
run: | | ||
mkdir cmake.output | ||
cd cmake.output | ||
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. | ||
cmake --build . -- -j$(nproc) | ||
- name: CMake build | ||
if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }} | ||
run: | | ||
mkdir cmake.output | ||
cd cmake.output | ||
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. | ||
cmake --build . -- -j$(nproc) | ||
- name: CMake build (with GUI) | ||
if: matrix.build_gui | ||
run: | | ||
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
cmake --build cmake.output -- -j$(nproc) | ||
- name: Run CMake test | ||
if: matrix.image != 'ubuntu:16.04' | ||
run: | | ||
cmake --build cmake.output --target check -- -j$(nproc) | ||
build_make: | ||
|
||
strategy: | ||
matrix: | ||
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04", "ubuntu:24.10"] | ||
fail-fast: false # Prefer quick result | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
container: | ||
image: ${{ matrix.image }} | ||
|
||
steps: | ||
# we need to stay at v3 for now because Node 20 does not support the older distros | ||
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node) | ||
- uses: actions/checkout@v3 | ||
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' | ||
|
||
- uses: actions/checkout@v4 | ||
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' | ||
|
||
- name: Install missing software on ubuntu | ||
if: contains(matrix.image, 'ubuntu') | ||
run: | | ||
apt-get update | ||
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev | ||
# needs to be called after the package installation since | ||
# - it doesn't call "apt-get update" | ||
# | ||
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178. | ||
# using the older version will cause a two minute hang in its post-run step. | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' | ||
with: | ||
key: ${{ github.workflow }}-${{ matrix.image }} | ||
|
||
# needs to be called after the package installation since | ||
# - it doesn't call "apt-get update" | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' | ||
with: | ||
key: ${{ github.workflow }}-${{ matrix.image }} | ||
|
||
- name: Build cppcheck | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w" | ||
- name: Build test | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w" | ||
- name: Run test | ||
run: | | ||
make -j$(nproc) check HAVE_RULES=yes | ||
# requires python3 | ||
- name: Run extra tests | ||
run: | | ||
tools/generate_and_run_more_tests.sh | ||
# requires which | ||
- name: Validate | ||
run: | | ||
make -j$(nproc) checkCWEEntries validateXML | ||
- name: Test addons | ||
run: | | ||
./cppcheck --addon=threadsafety 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 | ||
Oops, something went wrong.