-
Notifications
You must be signed in to change notification settings - Fork 280
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 #2963 from Xarthisius/gha
Migrate from Travis to GitHub Actions
- Loading branch information
Showing
6 changed files
with
126 additions
and
195 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,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 |
This file was deleted.
Oops, something went wrong.
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
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.