prevent exceeding array bounds #24
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: CI | |
on: [push, pull_request] | |
jobs: | |
gcc-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
gcc-v: [10] | |
build-type: [default] | |
include: | |
- os: macos-latest | |
gcc-v: 6 | |
build-type: default | |
- os: ubuntu-latest | |
gcc-v: 9 | |
build-type: coverage | |
- os: ubuntu-latest | |
gcc-v: 10 | |
build-type: coverage | |
- os: ubuntu-latest | |
gcc-v: 11 | |
build-type: coverage | |
- os: ubuntu-latest | |
gcc-v: 12 | |
build-type: coverage | |
defaults: | |
run: | |
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash -l {0}' }} | |
env: | |
FC: gfortran | |
GCC_V: ${{ matrix.gcc-v }} | |
OMP_NUM_THREADS: 2,1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- name: Install GCC (OSX) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
brew install gcc@${{ env.GCC_V }} | |
ln -s /usr/local/bin/gfortran-${{ env.GCC_V }} /usr/local/bin/gfortran | |
which gfortran-${{ env.GCC_V }} | |
which gfortran | |
- name: Install GCC (Linux) | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y gcc-${{ env.GCC_V }} gfortran-${{ env.GCC_V }} | |
sudo update-alternatives \ | |
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_V }} 100 \ | |
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ env.GCC_V }} \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ env.GCC_V }} | |
- name: Install GCC (Windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ucrt64 | |
update: false | |
path-type: inherit | |
pacboy: >- | |
gcc-fortran:p | |
cmake:p | |
meson:p | |
ninja:p | |
- name: Install meson/cmake | |
if: ${{ ! contains(matrix.os, 'windows') }} | |
run: pip3 install meson cmake ninja gcovr | |
- name: Configure meson build | |
run: meson setup build ${{ env.meson_args }} | |
env: | |
meson_args: >- | |
${{ matrix.build-type == 'coverage' && '-Db_coverage=true' || '' }} | |
- name: Build library (meson) | |
run: meson compile -C build | |
- name: Run unit tests (meson) | |
run: meson test -C build --print-errorlogs --no-rebuild | |
- name: Create coverage report | |
if: ${{ matrix.build-type == 'coverage' }} | |
run: | |
ninja -C build coverage | |
- name: Configure cmake build | |
run: cmake -B _build -G Ninja | |
- name: Build library (CMake) | |
run: cmake --build _build | |
- name: Run unit tests (CTest) | |
run: | | |
pushd _build | |
ctest | |
popd | |
- name: Upload coverage report | |
if: ${{ matrix.build-type == 'coverage' }} | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |