Skip to content

Commit

Permalink
Merge pull request #326 from altendky/release/v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky authored May 12, 2021
2 parents 1264e7a + a727040 commit e259507
Show file tree
Hide file tree
Showing 27 changed files with 1,055 additions and 280 deletions.
19 changes: 19 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[paths]
source =
src
*/site-packages

[report]
precision = 1
exclude_lines =
pragma: no cover
abc\.abstractmethod
typing\.overload
if typing.TYPE_CHECKING:
^\s*pass\s*$
^\s*...\s*$

[run]
branch = True
source =
plotman
121 changes: 118 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CI

on:
push:
branches: [ development ]
branches:
- main
- development
tags: [ "**" ]
pull_request:
branches: [ "**" ]
Expand All @@ -13,7 +15,8 @@ defaults:

jobs:
build:
name: ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
Expand All @@ -30,6 +33,10 @@ jobs:
- name: Build
tox: build

env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -71,7 +78,8 @@ jobs:
path: dist/

test:
name: ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
runs-on: ${{ matrix.os.runs-on }}
needs:
- build
Expand All @@ -98,6 +106,7 @@ jobs:
task:
- name: Test
tox: test
coverage: true
include:
- task:
name: Check
Expand All @@ -111,6 +120,8 @@ jobs:


env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
TOXENV: ${{ matrix.task.tox }}${{ fromJSON('["", "-"]')[matrix.python.tox != null] }}${{ matrix.python.tox }}

steps:
Expand Down Expand Up @@ -157,12 +168,116 @@ jobs:
run: |
tox --skip-pkg-install
- name: Coverage Processing
if: matrix.task.coverage
run: |
mkdir coverage_reports
cp .coverage "coverage_reports/.coverage.${{ env.JOB_NAME }}"
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_NAME }}.xml"
- name: Publish Coverage
if: matrix.task.coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage_reports/*

coverage:
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
runs-on: ${{ matrix.os.runs-on }}
needs:
- test
strategy:
fail-fast: false
matrix:
include:
- os:
name: Linux
runs-on: ubuntu-latest
python:
name: CPython 3.8
action: 3.8
task:
name: Coverage
tox: check-coverage
coverage: false
download_coverage: true

env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
TOXENV: ${{ matrix.task.tox }}${{ fromJSON('["", "-"]')[matrix.task.tox != null && matrix.python.tox != null] }}${{ matrix.python.tox }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Download package files
uses: actions/download-artifact@v2
with:
name: dist
path: dist/

- name: Download Coverage
if: matrix.task.download_coverage
uses: actions/download-artifact@v2
with:
name: coverage
path: coverage_reports

- name: Set up ${{ matrix.python.name }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python.action }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install tox
- name: Prepare tox environment
run: |
tox --notest --installpkg dist/*.whl
- name: Runner info
uses: twisted/python-info-action@v1

- name: Tox info
uses: twisted/python-info-action@v1
with:
python-path: .tox/${{ env.TOXENV }}/*/python

- name: Run tox environment
env:
BASE_REF: ${{ fromJSON(format('[{0}, {1}]', toJSON(github.event.before), toJSON(format('origin/{0}', github.base_ref))))[github.base_ref != ''] }}
run: |
tox --skip-pkg-install -- --compare-branch="${BASE_REF}"
- name: Coverage Processing
if: always()
run: |
mkdir all_coverage_report
cp .coverage "all_coverage_report/.coverage.all"
cp coverage.xml "all_coverage_report/coverage.all.xml"
- name: Upload Coverage
if: always()
uses: actions/upload-artifact@v2
with:
name: coverage
path: all_coverage_report/*

all:
name: All
runs-on: ubuntu-latest
needs:
- build
- test
# TODO: make this required when we have a better testing situation
# - coverage
steps:
- name: This
shell: python
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__
venv
.DS_Store
.vscode
Loading

0 comments on commit e259507

Please sign in to comment.