Skip to content

Commit

Permalink
Merge pull request #2963 from Xarthisius/gha
Browse files Browse the repository at this point in the history
Migrate from Travis to GitHub Actions
  • Loading branch information
munkm authored Nov 17, 2020
2 parents 94aedbc + 487c322 commit 43275cf
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 195 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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]
dependencies: [full]
tests-type: [unit]
include:
- os: ubuntu-18.04
python-version: 3.6
dependencies: minimal
tests-type: unit
- os: ubuntu-18.04
python-version: 3.7
dependencies: full
tests-type: answer

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: Install dependencies and yt
shell: bash
env:
dependencies: ${{ matrix.dependencies }}
run: source ./tests/ci_install.sh
- name: Run Tests
env:
testsuite: ${{ matrix.tests-type }}
run: python -m nose -c nose_${testsuite}.cfg --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.

70 changes: 70 additions & 0 deletions tests/ci_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
set -x # Show which command is being run

case ${RUNNER_OS} in
linux|Linux)
sudo apt-get -qqy 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

# Disable excessive output
mkdir -p $HOME/.config/yt
echo "[yt]" > $HOME/.config/yt/ytrc
echo "suppressStreamLogging = True" >> $HOME/.config/yt/ytrc
cat $HOME/.config/yt/ytrc
# Sets default backend to Agg
cp tests/matplotlibrc .

# Step 1: pre-install required packages
if [[ "${RUNNER_OS}" == "Windows" ]] && [[ ${dependencies} != "minimal" ]]; 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)

CARTOPY=$(grep cartopy tests/test_requirements.txt)
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 --quiet --yes -c conda-forge \
$CYTHON $NUMPY $CARTOPY $H5PY $MATPLOTLIB $SCIPY
else
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)
if [[ ${dependencies} == "minimal" ]]; then
# Ensure numpy and cython are installed so dependencies that need to be built
# 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.
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.
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
python -m pip install -e .

set +x
48 changes: 0 additions & 48 deletions tests/travis_before_install.sh

This file was deleted.

45 changes: 0 additions & 45 deletions tests/travis_install.sh

This file was deleted.

0 comments on commit 43275cf

Please sign in to comment.