-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (53 loc) · 1.85 KB
/
deploy.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
name: Reddit-Get Deployment
on:
release:
branches: [ main ]
types: [ published ] # published means created but not draft or prerelease
jobs:
test_build_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4.4.0
with:
python-version: 3.11.x
- name: Update pip, setuptools, and wheel
run: pip install -U pip setuptools wheel
- name: Setup Poetry
uses: abatilo/actions-poetry@v2.2.0
with:
poetry-preview: true
- name: Display Python Version
run: |
python --version
pip --version
poetry --version
- name: Cache Dependencies
uses: actions/cache@v3.2.0
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Poetry Dependencies
run: poetry install -vvv
- name: Run pytest with black, isort, and coverage
run: poetry run pytest -vvv --mypy --black --isort --cov=reddit_get --cov-fail-under=90 --cov-report=xml:docs/coverage/deployment/report.xml --numprocesses=auto --color=yes
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: .docs/coverage/deployment/report.xml
- name: Build Wheel
run: poetry build -vvv
- name: Configure Poetry for PyPI
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_API_TOKEN
- name: Deploy to PyPI
run: poetry publish