Skip to content

Commit

Permalink
Merge pull request #651 from bccp/githubactions
Browse files Browse the repository at this point in the history
Switch to github actions
  • Loading branch information
rainwoodman committed Apr 20, 2021
2 parents c4d4b23 + 247ac68 commit 2f77432
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 63 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# main test workflow; ported from .travis.yaml


name: main

on:
schedule:
- cron: '* * * * 5' # Runs on every Friday.
push:
branches: [ '*', $default-branch ]
tags: ['[0-9]*'] # anything looks like a version.
pull_request:
branches: [ $default-branch ]

jobs:
build:
runs-on: ${{ matrix.os }}
env:
OMP_NUM_THREADS: 1

defaults:
run:
shell: bash -l {0} # for conda.

strategy:
fail-fast: false
matrix:
# Disable os-latest as we run into a dask error for now.
# os: [ ubuntu-latest, macos-latest ]
os: [ ubuntu-latest ]
numpy-version: [ 1.18 ]
python-version: [ 3.8 ]
include:
- {deploy: true, os: ubuntu-latest, numpy-version: 1.18, python-version: 3.8 }
steps:

- name: Checkout source code
uses: actions/checkout@v2

- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache.
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2.0.1
with:
activate-environment: test
channels: bccp
show-channel-urls: true
use-only-tar-bz2: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Setup test env
run: |
conda install -q -y \
python=${{ matrix.python-version }} \
numpy=${{ matrix.numpy-version }} \
nose cython mpi4py \
--file requirements.txt \
--file requirements-extras.txt
# submitting coverage to coveralls
pip install coveralls
# install nbodykit itself
pip install .[extras]
# - name: Install Compilers For OSX
# if: ${{ runner.os == "macOS" }}
# run: |
# conda install -q -y clang_osx-64 clangxx_osx-64 gfortran_osx-64

# - name: Install Compilers For Linux
# if: ${{ runner.os == "Linux" }}
# run: |
# conda install -q -y gcc_linux-64 gxx_linux-64 gfortran_linux-64

- name: Python Unit tests
run: |
python run-tests.py -v --mpirun='mpirun -n 4' --with-coverage
- name: Build Python sdist
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
run: |
bash check_tag.sh "${GITHUB_REF##*/}" bigfile/version.py
python setup.py sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
with:
password: ${{ secrets.PYPI_SECRET }}
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions nbodykit/tests/test_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from nbodykit import set_options, GlobalCache, use_distributed, use_mpi
from numpy.testing import assert_array_equal
from nbodykit.lab import UniformCatalog
import pytest

def setup():
from distributed import LocalCluster, Client
Expand All @@ -21,6 +22,10 @@ def test_pickle(comm):

assert_array_equal(cat['Position'], cat2['Position'])

import distributed

@pytest.mark.xfail(distributed.__version__ in ['2021.03.0',],
reason="https://github.com/dask/distributed/issues/4565")
@MPITest([1])
def test_save(comm):
cat = UniformCatalog(1e-3, 512, comm=comm)
Expand Down

0 comments on commit 2f77432

Please sign in to comment.