Skip to content

Commit

Permalink
Migrate to GitHub Actions (#155)
Browse files Browse the repository at this point in the history
* Migrate to GitHub Actions

* Fix environment file name

* Quiet conda

* Success message

* Exclude versioneer from flake8
  • Loading branch information
jacobtomlinson committed Nov 5, 2020
1 parent 84ca438 commit 9f3fc1d
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 55 deletions.
51 changes: 0 additions & 51 deletions .circleci/config.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8"]

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

- name: Setup Conda Environment
uses: goanpeca/setup-miniconda@v1.7.0
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
environment-file: ci/environment-${{ matrix.python-version }}.yml
activate-environment: dask-cloudprovider-test
auto-activate-base: false

- name: Install
shell: bash -l {0}
run: pip install -e .[all]

- name: Run tests
shell: bash -l {0}
run: py.test dask_cloudprovider

lint:
name: "pre-commit hooks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0

imports:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Conda Environment
uses: goanpeca/setup-miniconda@v1.7.0
with:
miniconda-version: "latest"
python-version: "3.7"

- name: Run import tests
shell: bash -l {0}
run: source ci/scripts/test_imports.sh
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Dask Cloud Provider
===================


.. image:: https://img.shields.io/circleci/build/github/dask/dask-cloudprovider?logo=circleci
:target: https://circleci.com/gh/dask/dask-cloudprovider
:alt: CircleCI
.. image:: https://github.com/dask/dask-cloudprovider/workflows/CI/badge.svg
:target: https://github.com/dask/dask-cloudprovider/actions?query=workflow%3ACI
:alt: Build Status

.. image:: https://img.shields.io/readthedocs/dask-cloudprovider
:target: https://cloudprovider.dask.org/
Expand Down
32 changes: 32 additions & 0 deletions ci/environment-3.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: dask-cloudprovider-test
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- nomkl
- pip
# testing / CI
- flake8
- ipywidgets
- pytest
- black >=20.8b1
- pyyaml
# dask dependencies
- cloudpickle
- toolz
- cytoolz
- numpy
- partd
# distributed dependencies
- click >=6.6
- msgpack-python
- psutil >=5.0
- six
- sortedcontainers !=2.0.0,!=2.0.1
- tblib
- tornado >=5
- zict >=0.1.3
- pip:
- git+https://github.com/dask/dask
- git+https://github.com/dask/distributed
20 changes: 20 additions & 0 deletions ci/scripts/test_imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -o errexit


test_import () {
echo "Create environment: python=3.7 $1"
# Create an empty environment
conda create -q -y -n test-imports -c conda-forge python=3.7
conda activate test-imports
pip install -e .[$1]
echo "python -c '$2'"
python -c "$2"
echo "Success [$1] 🚀"
conda deactivate
conda env remove -n test-imports
}

test_import "aws" "import dask_cloudprovider.aws"
test_import "azure" "import dask_cloudprovider.azure"
test_import "digitalocean" "import dask_cloudprovider.digitalocean"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://flake8.readthedocs.io/en/latest/user/error-codes.html

# Note: there cannot be spaces after comma's here
exclude = __init__.py
exclude = __init__.py,versioneer.py,dask_cloudprovider/_version.py
ignore =
# Extra space in brackets
E20,
Expand Down

0 comments on commit 9f3fc1d

Please sign in to comment.