Skip to content

Commit

Permalink
CI-unixish.yml: run CMake build (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Sep 12, 2023
1 parent da449d1 commit 42090bd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:

runs-on: ${{ matrix.os }}

env:
CXX: ${{ matrix.compiler }}

steps:
- uses: actions/checkout@v3

Expand All @@ -23,53 +26,66 @@ jobs:
sudo apt-get install valgrind
- name: make simplecpp
run: make -j$(nproc) CXX=${{ matrix.compiler }}
run: make -j$(nproc)

- name: make test
run: make -j$(nproc) test CXX=${{ matrix.compiler }}
run: make -j$(nproc) test

- name: selfcheck
run: |
make -j$(nproc) selfcheck CXX=${{ matrix.compiler }}
make -j$(nproc) selfcheck
- name: Run CMake
run: |
cmake -S . -B cmake.output
- name: CMake simplecpp
run: |
cmake --build cmake.output --target simplecpp -- -j $(nproc)
- name: CMake testrunner
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
./cmake.output/testrunner
- name: Run valgrind
if: matrix.os == 'ubuntu-22.04'
run: |
make clean
# this valgrind version doesn't support DWARF 5 yet
make -j$(nproc) CXX=${{ matrix.compiler }} CXXFLAGS="-gdwarf-4"
make -j$(nproc) CXXFLAGS="-gdwarf-4"
valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./testrunner
valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./simplecpp simplecpp.cpp -e
- name: Run with libstdc++ debug mode
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'g++'
run: |
make clean
make -j$(nproc) test selfcheck CXX=${{ matrix.compiler }} CXXFLAGS="-g3 -D_GLIBCXX_DEBUG"
make -j$(nproc) test selfcheck CXXFLAGS="-g3 -D_GLIBCXX_DEBUG"
- name: Run with libc++ debug mode
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'clang++'
run: |
make clean
make -j$(nproc) test selfcheck CXX=${{ matrix.compiler }} CXXFLAGS="-stdlib=libc++ -g3 -D_LIBCPP_ENABLE_ASSERTIONS=1" LDFLAGS="-lc++"
make -j$(nproc) test selfcheck CXXFLAGS="-stdlib=libc++ -g3 -D_LIBCPP_ENABLE_ASSERTIONS=1" LDFLAGS="-lc++"
- name: Run AddressSanitizer
if: matrix.os == 'ubuntu-22.04'
run: |
make clean
make -j$(nproc) test selfcheck CXX=${{ matrix.compiler }} CXXFLAGS="-O2 -g3 -fsanitize=address" LDFLAGS="-fsanitize=address"
make -j$(nproc) test selfcheck CXXFLAGS="-O2 -g3 -fsanitize=address" LDFLAGS="-fsanitize=address"
env:
ASAN_OPTIONS: detect_stack_use_after_return=1

- name: Run UndefinedBehaviorSanitizer
if: matrix.os == 'ubuntu-22.04'
run: |
make clean
make -j$(nproc) test selfcheck CXX=${{ matrix.compiler }} CXXFLAGS="-O2 -g3 -fsanitize=undefined -fno-sanitize=signed-integer-overflow" LDFLAGS="-fsanitize=undefined -fno-sanitize=signed-integer-overflow"
make -j$(nproc) test selfcheck CXXFLAGS="-O2 -g3 -fsanitize=undefined -fno-sanitize=signed-integer-overflow" LDFLAGS="-fsanitize=undefined -fno-sanitize=signed-integer-overflow"
# TODO: requires instrumented libc++
- name: Run MemorySanitizer
if: false && matrix.os == 'ubuntu-22.04' && matrix.compiler == 'clang++'
run: |
make clean
make -j$(nproc) test selfcheck CXX=${{ matrix.compiler }} CXXFLAGS="-O2 -g3 -stdlib=libc++ -fsanitize=memory" LDFLAGS="-lc++ -fsanitize=memory"
make -j$(nproc) test selfcheck CXXFLAGS="-O2 -g3 -stdlib=libc++ -fsanitize=memory" LDFLAGS="-lc++ -fsanitize=memory"
4 changes: 1 addition & 3 deletions .github/workflows/CI-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ jobs:
if: matrix.os == 'windows-2019'
run: |
cmake -G "Visual Studio 16 2019" -A x64 . || exit /b !errorlevel!
dir
- name: Run cmake
if: matrix.os == 'windows-2022'
run: |
cmake -G "Visual Studio 17 2022" -A x64 . || exit /b !errorlevel!
dir
- name: Build
run: |
msbuild -m simplecpp.sln /p:Configuration=${{ matrix.config }} /p:Platform=x64 || exit /b !errorlevel!
Expand Down

0 comments on commit 42090bd

Please sign in to comment.