-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
8,653 additions
and
710 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,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 |
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 |
---|---|---|
|
@@ -8,5 +8,7 @@ __pycache__ | |
build | ||
dist | ||
docs/_build | ||
docs/generated | ||
references | ||
zenodo | ||
poetry.lock |
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,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 |
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,8 @@ | ||
build: | ||
image: latest | ||
|
||
python: | ||
version: 3.6 | ||
pip_install: true | ||
extra_requirements: | ||
- read-the-docs |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.