Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Oct 27, 2019
2 parents 3fb802c + cb82b17 commit 8eec8d1
Show file tree
Hide file tree
Showing 78 changed files with 8,653 additions and 710 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Continuous Integration

on: [push, pull_request]

jobs:
unix-build:
name: Unix Build
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [3.6]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Environment Variables
run: |
CI_PYTHON_VERSION=${{ matrix.python-version }}
CI_PACKAGE=colour_datasets
CI_SHA=${{ github.sha }}
CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *${CI_SHA:0:7}* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_SUCCESS_NOTIFICATION/4CAF50/F44336}"
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_FAILURE_NOTIFICATION/succeeded/failed}"
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
echo ::set-env name=CI_PYTHON_VERSION::$CI_PYTHON_VERSION
echo ::set-env name=CI_PACKAGE::$CI_PACKAGE
echo ::set-env name=CI_SHA::$CI_SHA
echo ::set-env name=CI_SLACK_WEBHOOK::$CI_SLACK_WEBHOOK
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::$CI_SLACK_SUCCESS_NOTIFICATION
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::$CI_SLACK_FAILURE_NOTIFICATION
echo ::set-env name=COVERALLS_REPO_TOKEN::$COVERALLS_REPO_TOKEN
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
python get-poetry.py --preview
PATH=$HOME/.poetry/bin:$PATH
echo ::set-env name=PATH::$PATH
- name: Install Package Dependencies
run: |
poetry install
poetry env use $CI_PYTHON_VERSION
- name: Lint with flake8
run: |
source $(poetry env info -p)/bin/activate
flake8 $CI_PACKAGE --count --show-source --statistics
- name: Test with nosetests
run: |
source $(poetry env info -p)/bin/activate
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
- name: Upload Coverage to coveralls.io
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
run: |
source $(poetry env info -p)/bin/activate
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else coveralls; fi
- name: Notify Slack
if: always()
run: |
if [ "${{ job.status }}" == "Success" ]; then CI_SLACK_NOTIFICATION="$CI_SLACK_SUCCESS_NOTIFICATION"; else CI_SLACK_NOTIFICATION="$CI_SLACK_FAILURE_NOTIFICATION"; fi
if [ -z "$CI_SLACK_WEBHOOK" ]; then echo \"SLACK_WEBHOOK\" secret is undefined!; else curl -k -d "$CI_SLACK_NOTIFICATION" -X POST $CI_SLACK_WEBHOOK; fi
windows-build:
name: Windows Build
strategy:
matrix:
os: [windows-2019]
python-version: [3.6]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Environment Variables
run: |
set CI_PYTHON_VERSION=${{ matrix.python-version }}
set CI_PACKAGE=colour_datasets
set CI_SHA=${{ github.sha }}
set CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
set CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *"%CI_SHA:~0,7%"* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION:4CAF50=F44336%
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION:succeeded=failed%
set COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
echo ::set-env name=CI_PYTHON_VERSION::%CI_PYTHON_VERSION%
echo ::set-env name=CI_PACKAGE::%CI_PACKAGE%
echo ::set-env name=CI_SHA::%CI_SHA%
echo ::set-env name=CI_SLACK_WEBHOOK::%CI_SLACK_WEBHOOK%
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::%CI_SLACK_SUCCESS_NOTIFICATION%
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::%CI_SLACK_FAILURE_NOTIFICATION%
echo ::set-env name=COVERALLS_REPO_TOKEN::%COVERALLS_REPO_TOKEN%
shell: cmd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
python get-poetry.py --preview
set PATH=%USERPROFILE%\.poetry\bin;%PATH%
echo ::set-env name=PATH::%PATH%
shell: cmd
- name: Install Package Dependencies
run: |
call poetry install
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
shell: cmd
- name: Lint with flake8
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
flake8 %CI_PACKAGE% --count --show-source --statistics
shell: cmd
- name: Test with nosetests
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
python -W ignore -m nose --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=%CI_PACKAGE% %CI_PACKAGE%
shell: cmd
- name: Upload Coverage to coveralls.io
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
run: |
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
IF "%COVERALLS_REPO_TOKEN%"=="" (echo "COVERALLS_REPO_TOKEN" secret is undefined!) ELSE (coveralls)
shell: cmd
- name: Notify Slack
if: always()
run: |
IF "${{ job.status }}"=="Success" (set CI_SLACK_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION%) ELSE (set CI_SLACK_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION%)
IF "%CI_SLACK_WEBHOOK%"=="" (echo "SLACK_WEBHOOK" secret is undefined!) ELSE (curl -k -d %CI_SLACK_NOTIFICATION% -X POST %CI_SLACK_WEBHOOK%)
shell: cmd
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ __pycache__
build
dist
docs/_build
docs/generated
references
zenodo
poetry.lock
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8
exclude: examples
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.23.0
hooks:
- id: yapf
8 changes: 8 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build:
image: latest

python:
version: 3.6
pip_install: true
extra_requirements:
- read-the-docs
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 8eec8d1

Please sign in to comment.