diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ea1acf3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build: + name: linux (OMP_NUM_THREADS=${{ matrix.omp_threads }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + omp_threads: [1, 8] + env: + OMP_NUM_THREADS: ${{ matrix.omp_threads }} + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y autoconf automake libtool guile-3.0-dev + + - name: Build and test + run: | + sh autogen.sh --prefix=$PWD/.local --enable-openmp + make + make check + make install + + - name: Print test logs on failure + if: failure() + run: | + for log in utils/*.log; do + [ -f "$log" ] && { echo "=== $log ==="; cat "$log"; } + done diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5d6367c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: c -sudo: false - -matrix: - include: - - os: linux - addons: - apt: - packages: - - autoconf - - automake - - libtool - - guile-2.0-dev - script: - - sh autogen.sh --prefix=`pwd`/.local - - make && make check && make install - - rm -rf * ~/.local - - os: osx - install: - - brew update - - brew install guile - script: - - sh autogen.sh --prefix=`pwd`/.local - - make && make check && make install - - rm -rf * ~/.local - -after_script: - - PRISM_LOG=${TRAVIS_BUILD_DIR}/utils/test-prism.log - - if [[ -e ${PRISM_LOG} ]]; then cat ${PRISM_LOG}; fi diff --git a/README.md b/README.md index d127bbd..fc0bd37 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Latest Docs](https://readthedocs.org/projects/pip/badge/?version=latest)](http://libctl.readthedocs.io/en/latest/) -[![Build Status](https://travis-ci.org/NanoComp/libctl.svg?branch=master)](https://travis-ci.org/NanoComp/libctl) +[![CI](https://github.com/NanoComp/libctl/actions/workflows/ci.yml/badge.svg)](https://github.com/NanoComp/libctl/actions/workflows/ci.yml) This is libctl, a [Guile](http://www.gnu.org/software/guile/)-based library for supporting flexible control files in scientific simulations.