-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #651 from bccp/githubactions
Switch to github actions
- Loading branch information
Showing
3 changed files
with
103 additions
and
63 deletions.
There are no files selected for viewing
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
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/[email protected] | ||
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 }} |
This file was deleted.
Oops, something went wrong.
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