Allow hash table type to be macro-expanded #279
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: CI pipeline | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - 'dev-*' | |
| env: | |
| build_dir: build | |
| config: Release | |
| jobs: | |
| analyze: | |
| name: Run analyzers | |
| runs-on: ${{vars.ubuntu_runner || 'ubuntu-latest'}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| types: [normal, tiny, huge] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Run pre-commit | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install pre-commit | |
| pre-commit run --from-ref=HEAD~1 --to-ref=HEAD | |
| - name: Configure CMake | |
| run: > | |
| CC=clang cmake -B ${{env.build_dir}} | |
| -DULIB_CPP_TESTS=OFF | |
| -DULIB_TINY=${{matrix.types == 'tiny' && 'ON' || 'OFF'}} | |
| -DULIB_HUGE=${{matrix.types == 'huge' && 'ON' || 'OFF'}} | |
| -DULIB_LTO=OFF | |
| -DULIB_CLANG_TIDY=ON | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=ON | |
| - name: Build | |
| run: cmake --build ${{env.build_dir}} | |
| test: | |
| name: Test | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ${{vars.ubuntu_runner || 'ubuntu-latest'}} | |
| - ${{vars.windows_runner || 'windows-latest'}} | |
| - ${{vars.macos_runner || 'macos-latest'}} | |
| lib_type: [STATIC, SHARED] | |
| types: [normal, tiny, huge] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{env.build_dir}} | |
| -DULIB_LIBRARY_TYPE=${{matrix.lib_type}} | |
| -DULIB_TINY=${{matrix.types == 'tiny' && 'ON' || 'OFF'}} | |
| -DULIB_HUGE=${{matrix.types == 'huge' && 'ON' || 'OFF'}} | |
| -DULIB_LEAKS=ON | |
| -DULIB_SANITIZERS=ON | |
| -DCMAKE_SYSTEM_VERSION='' | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=ON | |
| -DCMAKE_BUILD_TYPE=${{env.config}} | |
| - name: Build | |
| run: > | |
| cmake --build ${{env.build_dir}} --config ${{env.config}} | |
| - name: Configure tests (Windows) | |
| working-directory: ${{env.build_dir}} | |
| if: runner.os == 'Windows' | |
| run: | | |
| if [ ${{matrix.lib_type}} == 'SHARED' ]; then | |
| for exe_dir in test bench; do | |
| cp ${{env.config}}/*.dll ${exe_dir}/${{env.config}} | |
| done | |
| fi | |
| shell: bash | |
| - name: Run tests | |
| working-directory: ${{env.build_dir}} | |
| run: ctest --build-config ${{env.config}} --output-on-failure | |
| bench: | |
| name: Benchmark | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ${{vars.ubuntu_runner || 'ubuntu-latest'}} | |
| - ${{vars.windows_runner || 'windows-latest'}} | |
| - ${{vars.macos_runner || 'macos-latest'}} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{env.build_dir}} | |
| -DULIB_LTO=ON | |
| -DULIB_OPTIMIZE_FOR_HOST=ON | |
| -DCMAKE_SYSTEM_VERSION='' | |
| -DCMAKE_BUILD_TYPE=${{env.config}} | |
| - name: Build | |
| run: cmake --build ${{env.build_dir}} --config ${{env.config}} --target ulib-bench | |
| - name: Configure (Windows) | |
| working-directory: ${{env.build_dir}}/bench | |
| if: runner.os == 'Windows' | |
| run: mv ${{env.config}}/*.exe ./ | |
| shell: bash | |
| - name: Run | |
| working-directory: ${{env.build_dir}}/bench | |
| run: ./ulib-bench | |
| docs: | |
| name: Generate the documentation | |
| runs-on: ${{vars.ubuntu_runner || 'ubuntu-latest'}} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build docs | |
| run: | | |
| sudo apt install doxygen | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install Sphinx sphinx-rtd-theme breathe | |
| cmake -B ${{env.build_dir}} -DULIB_DOCS=ON | |
| cmake --build ${{env.build_dir}} --target ulib-docs |