Merge pull request #55 from diofant/dependabot/github_actions/actions… #301
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: Run CI tests | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15-intel, macos-15] | |
| shell: [bash] | |
| msystem: [ucrt64] | |
| menv: [ucrt-x86_64] | |
| include: | |
| - os: windows-2022 | |
| shell: 'msys2 {0}' | |
| msystem: ucrt64 | |
| menv: ucrt-x86_64 | |
| - os: windows-11-arm | |
| shell: 'msys2 {0}' | |
| msystem: clangarm64 | |
| menv: clang-aarch64 | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 10.15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: | | |
| sudo apt update | |
| sudo apt install autoconf-archive lcov texlive | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| - run: brew install autoconf libtool | |
| if: matrix.os == 'macos-15' | |
| - run: brew install automake autoconf-archive lcov texinfo | |
| if: ${{ startsWith(matrix.os, 'macos') }} | |
| - uses: msys2/setup-msys2@v2.30.0 | |
| name: Setup msys2 | |
| with: | |
| install: >- | |
| mingw-w64-${{ matrix.menv }}-binutils | |
| mingw-w64-${{ matrix.menv }}-gcc | |
| mingw-w64-${{ matrix.menv }}-tools | |
| mingw-w64-${{ matrix.menv }}-lcov | |
| diffutils | |
| m4 | |
| make | |
| patch | |
| autotools | |
| autoconf-archive | |
| texinfo | |
| msystem: ${{ matrix.msystem }} | |
| if: ${{ startsWith(matrix.os, 'windows') }} | |
| - name: Cache GNU GMP builds | |
| id: cache-gmp | |
| uses: actions/cache@v5 | |
| with: | |
| path: .local | |
| key: ${{ matrix.os }}-${{ hashFiles('scripts/*') }} | |
| - run: sh scripts/cibw_before_all.sh | |
| if: steps.cache-gmp.outputs.cache-hit != 'true' | |
| - run: mkdir m4 && autoreconf -if | |
| - run: ./configure --enable-gcov --with-gmp=$(pwd)/.local/ | |
| - run: make all check CFLAGS="-Wall -Wpedantic -Werror -Wconversion" | |
| - run: | | |
| lcov --capture --no-recursion --directory .libs \ | |
| --output-file coverage.info | |
| - run: | | |
| lcov --remove coverage.info "*.h" --ignore-errors unused \ | |
| --output-file coverage-${{ matrix.os }}.info | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-${{ matrix.os }} | |
| path: | | |
| coverage-${{ matrix.os }}.info | |
| retention-days: 1 | |
| - run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-gmp=$(pwd)/.local/" | |
| if: runner.os == 'Linux' | |
| merge-coverage: | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - run: sudo apt update | |
| - run: sudo apt install lcov diff-cover | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| pattern: coverage-* | |
| merge-multiple: true | |
| - run: | | |
| genhtml coverage-u*.info --hierarchical \ | |
| --output-directory coverage | |
| - run: | | |
| diff-cover coverage-u*.info --fail-under=100 \ | |
| --compare-branch=origin/master | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage | |
| path: | | |
| coverage/ | |
| coverage*.info | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| gcov_include: '*.c' | |
| gcov_args: --no-external | |
| fail_ci_if_error: true |