-
-
Notifications
You must be signed in to change notification settings - Fork 46
124 lines (124 loc) · 3.88 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
pull_request:
jobs:
install_with_pip3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install with pip3 - no extras
run: |
pip3 install .
pip3 show syncall
- name: Install with pip3 - all extras
run: |
pip3 install .[tw,google,notion,gkeep,asana,caldav]
pip3 show syncall
- name: Install with pip3 - tw
run: |
pip3 install .[tw]
pip3 show syncall
- name: Install with pip3 - google
run: |
pip3 install .[google]
pip3 show syncall
- name: Install with pip3 - notion
run: |
pip3 install .[notion]
pip3 show syncall
- name: Install with pip3 - gkeep
run: |
pip3 install .[gkeep]
pip3 show syncall
- name: Install with pip3 - asana
run: |
pip3 install .[asana]
pip3 show syncall
- name: Install with pip3 - caldav
run: |
pip3 install .[caldav]
pip3 show syncall
unittests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: |
sudo ./scripts/install-taskwarrior.sh
poetry install --all-extras
poetry self add "poetry-dynamic-versioning[plugin]"
task --version
- name: Run tests
run: poetry run pytest
style_and_linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: |
poetry install -E google -E notion -E gkeep
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Run style checkers and linters
run: poetry run pre-commit run --all-files
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: |
sudo ./scripts/install-taskwarrior.sh
poetry install --all-extras
poetry self add "poetry-dynamic-versioning[plugin]"
task --version
- name: Coverage
run: |
poetry run coverage run -m pytest --doctest-modules
poetry run coverage report
# Using --service=github + secrets.GITHUB_TOKEN for builds originating from PRs to work
# Not sure if both are required
# https://github.com/TheKevJames/coveralls-python/issues/252
- name: Coveralls
run: poetry run coveralls --service=github || poetry run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish package to pypi
uses: JRubics/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"