✨ Analog information decoding #774
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
name: C++ | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 3 | |
CTEST_PARALLEL_LEVEL: 3 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
cpp-tests-ubuntu: | |
name: 🐧 Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install flint | |
run: sudo apt-get install libflint-dev | |
- name: Setup ccache | |
uses: Chocobo1/setup-ccache-action@v1 | |
with: | |
prepend_symlinks_to_path: false | |
override_cache_key: c++-tests-ubuntu-latest | |
- name: Set up mold as linker | |
uses: rui314/setup-mold@v1 | |
- name: Install Ninja | |
run: pipx install ninja | |
- name: Configure CMake | |
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build build --config Release | |
- name: Test | |
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 | |
cpp-tests-macos: | |
name: 🍎 Release | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup ccache | |
uses: Chocobo1/setup-ccache-action@v1 | |
with: | |
prepend_symlinks_to_path: false | |
override_cache_key: c++-tests-macos-latest | |
- name: Install Ninja | |
run: pipx install ninja | |
- if: runner.os == 'macOS' | |
name: Install flint | |
run: | | |
brew install gmp mpfr ntl | |
git clone --branch v2.9.0 --depth 1 https://github.com/flintlib/flint2.git | |
cd flint2 && ./configure && make -j 3 && make install | |
- name: Configure CMake | |
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build build --config Release | |
- name: Test | |
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 | |
coverage: | |
name: 📈 Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install flint | |
run: sudo apt-get install libflint-dev | |
- name: Setup ccache | |
uses: Chocobo1/setup-ccache-action@v1 | |
with: | |
prepend_symlinks_to_path: false | |
override_cache_key: c++-coverage | |
- name: Set up mold as linker | |
uses: rui314/setup-mold@v1 | |
- name: Install Ninja | |
run: pipx install ninja | |
- name: Configure CMake | |
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON | |
- name: Build | |
run: cmake --build build --config Debug | |
- name: Test | |
run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 | |
- name: Upload coverage to Codecov | |
# Coverage uploads can be flaky, so we retry them a few times. | |
uses: Wandalen/[email protected] | |
with: | |
action: codecov/codecov-action@v3 | |
attempt_limit: 5 | |
attempt_delay: 2000 | |
with: | | |
fail_ci_if_error: true | |
flags: cpp | |
gcov: true | |
gcov_ignore: "extern/**/*" | |
token: ${{ secrets.token }} |