c/Makefile (asan): Run with DEBUG=0 by default. #646
This file contains hidden or 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
| name: C | |
| on: | |
| push: | |
| branches: [main] | |
| tags-ignore: ["**"] | |
| paths: | |
| - '.github/workflows/C.yml' | |
| - 'c/Make*' | |
| - 'c/*.mk' | |
| - 'c/*.[ch]p?p?' | |
| pull_request: | |
| branches-ignore: [gh-pages] | |
| paths: | |
| - '.github/workflows/C.yml' | |
| - 'c/Make*' | |
| - 'c/*.mk' | |
| - 'c/*.[ch]p?p?' | |
| # Manual run | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: "! contains(github.event.head_commit.message, '[skip ci]')" | |
| name: Build C code on ${{ matrix.os }} with ${{ matrix.cc }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # macos-15-intel is an intel runner, macos-14 is apple silicon | |
| os: [ubuntu-22.04, windows-latest] | |
| cc: [ gcc ] | |
| cxx: [ g++ ] | |
| include: | |
| - { os: macos-14, cc: clang, cxx: clang++ } | |
| - { os: macos-14, cc: gcc-13, cxx: g++-13 } | |
| - { os: ubuntu-24.04, cc: gcc-14, cxx: g++-14 } | |
| - { os: macos-15-intel, cc: clang, cxx: clang++ } | |
| - { os: macos-15-intel, cc: gcc-15, cxx: g++-15 } | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Put MSYS2_MinGW64 on PATH | |
| if: runner.os == 'Windows' | |
| run: | | |
| echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| echo "${{ runner.temp }}/msys64/mingw64/usr/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - run: ${{ matrix.cc }} -v | |
| - run: ${{ matrix.cxx }} -v | |
| - run: make -C c all DEBUG=0 WERROR=1 | |
| - run: make -C c all DEBUG=1 WERROR=1 | |
| if: ${{ runner.os == 'Linux' || (runner.os == 'macOS' && matrix.cc == 'clang') }} | |
| - run: make -C c all DEBUG=1 WERROR=1 SANITIZERS= | |
| - name: Functional tests | |
| run: | | |
| ./bin/dominatedsets --help | |
| ./bin/eaf --help | |
| ./bin/epsilon --help | |
| ./bin/hv --help | |
| ./bin/hvapprox --help | |
| ./bin/igd --help | |
| ./bin/ndsort --help | |
| ./bin/nondominated --help | |
| # FIXME: Building shared libraries fails on windows. Not sure how to fix it. | |
| - name: Test building shared libraries | |
| if: ${{ runner.os != 'Windows' }} | |
| run: | | |
| make -C c shlibs DEBUG=0 WERROR=1 | |
| ./tools/check_so_symbols.sh ./c/libmoocore.* ./tools/expected_libmoocore_exports.txt | |
| ./tools/check_so_symbols.sh ./c/libmoocorepp.* ./tools/expected_libmoocore_exports.txt | |
| shell: bash | |
| msys2: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sys: [ clang64 ] | |
| cc: [ clang ] | |
| cxx: [ clang++ ] | |
| #- { sys: mingw64, cc: gcc } | |
| #- { sys: ucrt64, cc: gcc } | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Disable autocrlf | |
| shell: pwsh | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@v6 | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.sys }} | |
| update: true | |
| install: >- | |
| make | |
| diffutils | |
| pacboy: >- | |
| ${{ matrix.cc }}:p | |
| - run: make -C c all DEBUG=1 WARN_FLAGS='-Werror' | |
| - run: make -C c all DEBUG=0 WARN_FLAGS='-Werror' | |
| - name: Functional tests | |
| run: | | |
| ./bin/dominatedsets --help | |
| ./bin/eaf --help | |
| ./bin/epsilon --help | |
| ./bin/hv --help | |
| ./bin/hvapprox --help | |
| ./bin/igd --help | |
| ./bin/ndsort --help | |
| ./bin/nondominated --help | |
| - name: Test building shared libraries | |
| run: | | |
| make -C c shlibs DEBUG=0 WERROR=1 | |
| ./tools/check_so_symbols.sh c/libmoocore.* tools/expected_libmoocore_exports.txt | |
| ./tools/check_so_symbols.sh c/libmoocorepp.* tools/expected_libmoocore_exports.txt |