Skip to content

Commit 18ed0ea

Browse files
committed
Overhaul continuous integration setup.
1 parent 191d6dc commit 18ed0ea

File tree

2 files changed

+22
-81
lines changed

2 files changed

+22
-81
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 21 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@ name: Continuous Integration
33
on: [push, pull_request]
44

55
jobs:
6-
unix-build:
7-
name: Unix Build
6+
continuous-integration:
7+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-18.04, macOS-latest]
11-
python-version: [3.6, 3.7]
10+
os: [macOS-latest, ubuntu-18.04, windows-2019]
11+
python-version: [3.6, 3.7, 3.8]
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- uses: actions/checkout@v1
1515
with:
1616
submodules: true
1717
- name: Environment Variables
1818
run: |
19-
CI_PYTHON_VERSION=${{ matrix.python-version }}
20-
CI_PACKAGE=colour_checker_detection
21-
CI_SHA=${{ github.sha }}
22-
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
23-
echo ::set-env name=CI_PYTHON_VERSION::$CI_PYTHON_VERSION
24-
echo ::set-env name=CI_PACKAGE::$CI_PACKAGE
25-
echo ::set-env name=CI_SHA::$CI_SHA
26-
echo ::set-env name=COVERALLS_REPO_TOKEN::$COVERALLS_REPO_TOKEN
19+
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
20+
echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV
21+
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
22+
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
23+
shell: bash
2724
- name: Set up Python ${{ matrix.python-version }}
2825
uses: actions/setup-python@v1
2926
with:
@@ -32,80 +29,24 @@ jobs:
3229
run: |
3330
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
3431
python get-poetry.py
35-
PATH=$HOME/.poetry/bin:$PATH
36-
echo ::set-env name=PATH::$PATH
32+
python get-poetry.py --version 1.0.10
33+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
34+
shell: bash
3735
- name: Install Package Dependencies
3836
run: |
39-
poetry install
40-
source $(poetry env info -p)/bin/activate
41-
python -c "import imageio;imageio.plugins.freeimage.download()"
37+
poetry install --extras "optional plotting"
38+
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
39+
shell: bash
4240
- name: Lint with flake8
4341
run: |
44-
source $(poetry env info -p)/bin/activate
45-
flake8 $CI_PACKAGE --count --show-source --statistics
42+
poetry run flake8 $CI_PACKAGE --count --show-source --statistics
43+
shell: bash
4644
- name: Test with nosetests
4745
run: |
48-
source $(poetry env info -p)/bin/activate
49-
python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
46+
poetry run python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
47+
shell: bash
5048
- name: Upload Coverage to coveralls.io
5149
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
5250
run: |
53-
source $(poetry env info -p)/bin/activate
54-
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else coveralls; fi
55-
windows-build:
56-
name: Windows Build
57-
strategy:
58-
matrix:
59-
os: [windows-2019]
60-
python-version: [3.6, 3.7]
61-
runs-on: ${{ matrix.os }}
62-
steps:
63-
- uses: actions/checkout@v1
64-
with:
65-
submodules: true
66-
- name: Environment Variables
67-
run: |
68-
set CI_PYTHON_VERSION=${{ matrix.python-version }}
69-
set CI_PACKAGE=colour_checker_detection
70-
set CI_SHA=${{ github.sha }}
71-
set COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
72-
echo ::set-env name=CI_PYTHON_VERSION::%CI_PYTHON_VERSION%
73-
echo ::set-env name=CI_PACKAGE::%CI_PACKAGE%
74-
echo ::set-env name=CI_SHA::%CI_SHA%
75-
echo ::set-env name=COVERALLS_REPO_TOKEN::%COVERALLS_REPO_TOKEN%
76-
shell: cmd
77-
- name: Set up Python ${{ matrix.python-version }}
78-
uses: actions/setup-python@v1
79-
with:
80-
python-version: ${{ matrix.python-version }}
81-
- name: Install Poetry
82-
run: |
83-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
84-
python get-poetry.py
85-
set PATH=%USERPROFILE%\.poetry\bin;%PATH%
86-
echo ::set-env name=PATH::%PATH%
87-
shell: cmd
88-
- name: Install Package Dependencies
89-
run: |
90-
call poetry install
91-
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
92-
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
93-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
94-
python -c "import imageio;imageio.plugins.freeimage.download()"
95-
shell: cmd
96-
- name: Lint with flake8
97-
run: |
98-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
99-
flake8 %CI_PACKAGE% --count --show-source --statistics
100-
shell: cmd
101-
- name: Test with nosetests
102-
run: |
103-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
104-
python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=%CI_PACKAGE% %CI_PACKAGE%
105-
shell: cmd
106-
- name: Upload Coverage to coveralls.io
107-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
108-
run: |
109-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
110-
IF "%COVERALLS_REPO_TOKEN%"=="" (echo "COVERALLS_REPO_TOKEN" secret is undefined!) ELSE (coveralls)
111-
shell: cmd
51+
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
52+
shell: bash

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exclude = [
4545
]
4646

4747
[tool.poetry.dependencies]
48-
python = "^3.5"
48+
python = "^3.6"
4949
colour-science = "^0.3.14"
5050
opencv-python = "^4"
5151

0 commit comments

Comments
 (0)