-
-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (39 loc) · 1.28 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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install poetry
uses: abatilo/[email protected]
- name: Install dependencies
run: |
poetry install
- name: Run flake8
run: |
poetry run python -m flake8 --show-source --import-order-style pep8 typed_json_dataclass
- name: Run pytest
run: |
poetry run python -m pytest --cov-report xml:codecov.xml --cov=typed_json_dataclass --cov-report=html --junit-xml=coverage.xml --cov-branch --cov-fail-under=100 tests/
- if: github.event_name == 'push'
name: Publish
env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
poetry run codecov -t $CODECOV_TOKEN
poetry publish --build --no-interaction -vv --username $PYPI_USERNAME --password $PYPI_PASSWORD
- if: github.event_name == 'push'
name: Generate release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release