diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa68ac4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build-and-test: + name: ${{ matrix.os }} - ${{ matrix.compiler }} + runs-on: ${{ matrix.os }} + + permissions: + contents: read + + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + compiler: gcc + cxx: g++ + - os: ubuntu-latest + compiler: clang + cxx: clang++ + - os: macos-latest + compiler: clang + cxx: clang++ + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies (Ubuntu) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y cmake libboost-dev libgsl-dev + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install cmake gsl boost + + - name: Configure + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx }} + run: cmake . + + - name: Build + run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) + + - name: Test + run: ctest --output-on-failure diff --git a/.gitignore b/.gitignore index 8d336d7..f47bc55 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,14 @@ bin/* .DS_Store *~ *.swp +# Generated CMake files and build artifacts +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +Makefile +CTestTestfile.cmake +*.a +greens_functions/ +tablegen/make_cjy_table +tablegen/make_sjy_table +tests/GreensFunction*_test diff --git a/README.md b/README.md index 9bca1a2..1e30a24 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # greens functions -[![Build Status](https://travis-ci.org/ecell/greens_functions.svg?branch=master)](https://travis-ci.org/ecell/greens_functions) +[![CI](https://github.com/ecell/greens_functions/workflows/CI/badge.svg)](https://github.com/ecell/greens_functions/actions) for eGFRD simulation.