Skip to content

Commit

Permalink
Migrate the test suite to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarthisius committed Nov 12, 2020
1 parent 9112a67 commit ce5e21d
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 163 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Test

on: [push, pull_request]

defaults:
run:
shell: bash

env:
HOMEBREW_NO_AUTO_UPDATE: 1

jobs:

build:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04]
python-version: [3.8]
minimal: [false]
answer-tests: [false]
include:
- os: ubuntu-18.04
python-version: 3.6
minimal: true
answer-tests: false
- os: ubuntu-18.04
python-version: 3.7
minimal: false
answer-tests: true

runs-on: ${{ matrix.os }}
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- uses: s-weigand/setup-conda@v1
if: matrix.os == 'windows-latest'
with:
update-conda: true
conda-channels: conda-forge
activate-conda: true
python-version: ${{matrix.python-version}}
- name: Show env
shell: bash
run: |
echo PATH $PATH
echo python `which python`
python -c "import sys; print(sys.version)"
- name: Install dependencies and yt
shell: bash
run: |
if [ "${{ matrix.minimal }}" == "true" ]; then
export MINIMAL=1
fi
source ./tests/ci_install.sh
- name: Run Tests
run: |
if [ "${{ matrix.answer-tests }}" == "true" ]; then
export CONFIG=nose_answer.cfg
else
export CONFIG=nose_unit.cfg
fi
python -m nose -c $CONFIG --traverse-namespace
87 changes: 0 additions & 87 deletions .travis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions appveyor.yml

This file was deleted.

50 changes: 37 additions & 13 deletions tests/travis_install.sh → tests/ci_install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
set -x # Show which command is being run

echo "Travis build stage: $TRAVIS_BUILD_STAGE_NAME"
[[ -n ${RUNNER_OS} ]] && export TRAVIS_OS_NAME=${RUNNER_OS}

case ${RUNNER_OS} in
linux|Linux)
sudo apt-get install \
libhdf5-serial-dev \
libnetcdf-dev \
libproj-dev \
proj-data \
proj-bin \
libgeos-dev \
libopenmpi-dev
;;
osx|macOS)
sudo mkdir -p /usr/local/man
sudo chown -R "${USER}:admin" /usr/local/man
HOMEBREW_NO_AUTO_UPDATE=1 brew install hdf5 proj geos open-mpi netcdf ccache
;;
esac

mkdir -p $HOME/.config/yt
echo "[yt]" > $HOME/.config/yt/ytrc
echo "suppressStreamLogging = True" >> $HOME/.config/yt/ytrc
cat $HOME/.config/yt/ytrc
cp tests/matplotlibrc .

# Step 1: pre-install required packages
if [[ "$TRAVIS_OS_NAME" == "windows" ]] && [[ $MINIMAL != 1 ]]; then
if [[ "${RUNNER_OS}" == "Windows" ]] && [[ $MINIMAL != 1 ]]; then
# Install some dependencies using conda (if not doing a minimal run)
CYTHON=$(grep cython tests/test_prerequirements.txt)
NUMPY=$(grep numpy tests/test_prerequirements.txt)
Expand All @@ -12,13 +36,13 @@ if [[ "$TRAVIS_OS_NAME" == "windows" ]] && [[ $MINIMAL != 1 ]]; then
H5PY=$(grep h5py tests/test_requirements.txt)
MATPLOTLIB=$(grep matplotlib tests/test_requirements.txt)
SCIPY=$(grep scipy tests/test_requirements.txt)
conda config --set always_yes yes
conda info -a
conda install --yes -c conda-forge $CYTHON $NUMPY $CARTOPY $H5PY $MATPLOTLIB $SCIPY
else
ccache -s
# Upgrade pip and setuptools and wheel to get clean install
$PIP install --upgrade pip
$PIP install --upgrade wheel
$PIP install --upgrade setuptools
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade setuptools
fi

# Step 2: install required packages (depending on whether the build is minimal)
Expand All @@ -27,19 +51,19 @@ if [[ $MINIMAL == 1 ]]; then
# don't error out
# The first numpy to support py3.6 is 1.12, but numpy 1.13 matches
# unyt so we'll match it here.
$PIP install numpy==1.13.3 cython==0.26.1
$PIP install -r tests/test_minimal_requirements.txt
python -m pip install numpy==1.13.3 cython==0.26.1
python -m pip install -r tests/test_minimal_requirements.txt
else
# Getting cartopy installed requires getting cython and numpy installed
# first; this is potentially going to be fixed with the inclusion of
# pyproject.toml in cartopy.
# These versions are pinned, so we will need to update/remove them when
# the hack is no longer necessary.
$PIP install -r tests/test_prerequirements.txt
CFLAGS="$CFLAGS -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" $PIP install -r tests/test_requirements.txt
python -m pip install -r tests/test_prerequirements.txt
CFLAGS="$CFLAGS -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" python -m pip install -r tests/test_requirements.txt
fi

# Step 3: install yt
$PIP install -e .
python -m pip install -e .

set +x # Do not show which command is being run (Travis default)
set +x # Do not show which command is being run (Travis default)
48 changes: 0 additions & 48 deletions tests/travis_before_install.sh

This file was deleted.

0 comments on commit ce5e21d

Please sign in to comment.