Skip to content

Commit

Permalink
Github actions (#836)
Browse files Browse the repository at this point in the history
* testing gh

* test install

* basic

* almost there

* fake

* test name

* coveralls

* note

* note

* OSs and PYs

* OSs and PYs

* OSs and PYs

* no mac for now

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* just mac, testing

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* mac and ubuntu

* class...

* class...

* class...

* class...

* class...

* class...

* class...

* swig...

* cleanup

* oops

* simpler class

* c tests

* c tests

* MJ comments

* master
  • Loading branch information
damonge committed Dec 8, 2020
1 parent 46692a3 commit 766ca03
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 202 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: continuous-integration
on:
push:
branches:
- main
- master
- releases/*
pull_request:
branches:
- main
- master
- releases/*
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
py: [ 3.6, 3.7, 3.8, 3.9 ]
CC: [ gcc ]

# Check macos too
include:
- os: macos-latest
py: 3.7

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}

- name: Install GFortran macOS
# brew returns a failure exit code if
# the thing is already installed and
# current. Hence the `|| true` statement
if: matrix.os == 'macos-latest'
run: |
brew cask install gfortran || true
- name: Install GSL, FFTW, SWIG (macos)
if: matrix.os == 'macos-latest'
run: |
brew install fftw || true
brew install gsl || true
brew install swig || true
- name: Install GSL, FFTW (linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo -H apt-get install libgsl-dev libfftw3-dev
- name: Install python dependencies
run: |
python -m pip install -U pip
pip install -U numpy
pip install -U scipy
pip install -U pytest
pip install -U pytest-cov
pip install -U fast-pt
pip install -U camb
pip install -U isitgr
pip install -U cython
pip install -U flake8
- name: Install CLASS (linux)
if: matrix.os == 'ubuntu-latest'
run: |
git clone -b v2.7.2 --single-branch --depth 1 "https://github.com/lesgourg/class_public.git"
cd class_public
make
- name: Install CLASS (macos)
if: matrix.os == 'macos-latest'
run: |
git clone -b v2.7.2 --single-branch --depth 1 "https://github.com/lesgourg/class_public.git"
cd class_public
make CC=gcc-9
- name: Flake
run: |
flake8 pyccl
flake8 --exclude=data benchmarks
- name: Build CCL
run: |
python setup.py build
python setup.py develop
- name: C unit tests
run: |
cd build
make -j4
CLASS_PARAM_DIR=./extern/share/class/ OMP_NUM_THREADS=2 ./check_ccl
- name: Python unit tests
run: OMP_NUM_THREADS=2 pytest -vv pyccl --cov=pyccl

- name: Benchmarks
run: OMP_NUM_THREADS=2 pytest -vv benchmarks --cov=pyccl --cov-append

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install -U coveralls
coveralls
- name: Cache pip, brew
uses: actions/cache@v2
with:
path: |
~/.cache/pip
$HOME/Library/Caches/Homebrew
/usr/local/Cellar
key: ${{ runner.os }}-${{ matrix.py }}-cache
restore-keys: |
${{ runner.os }}-${{ matrix.py }}-cache
${{ runner.os }}-
build-doc-only-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install prereq using apt
run: |
sudo apt install texlive texlive-bibtex-extra texlive-science texlive-publishers latexmk python3-sphinx python3-sphinx-rtd-theme python3-nbconvert python3-jupyter-client jupyter-client jupyter-nbconvert sphinx-common pandoc python3-setuptools -y
sudo pip3 install mkauthlist
- name: Building docs
run: |
cd doc/0000-ccl_note
make
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .travis/install.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .travis/install_class_linux.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .travis/install_class_osx.sh

This file was deleted.

60 changes: 0 additions & 60 deletions .travis/install_texlive_linux.sh

This file was deleted.

10 changes: 0 additions & 10 deletions .travis/texlive/texlive.profile

This file was deleted.

0 comments on commit 766ca03

Please sign in to comment.