This repository was archived by the owner on Dec 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
96 lines (78 loc) · 2.23 KB
/
python.yaml
File metadata and controls
96 lines (78 loc) · 2.23 KB
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
name: Python
on:
push:
pull_request:
branches: [master]
release:
types:
- created
env:
PYTHON_VERSION: 3.9
jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
with:
extra_args: --verbose --all-files
test:
name: Run the tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- name: Run pytest
run: |
pytest -vv
pytest -vv > pytest-coverage.txt
- name: Comment coverage
uses: coroo/pytest-coverage-commentator@v1.0.2
if: ${{ github.event_name == 'pull_request' && github.event.action == 'created' }}
build:
name: Build linkedin_messaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- run: flit build
deploy:
name: Deploy to PyPi
runs-on: ubuntu-latest
needs: [lint, test, build]
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
env:
FLIT_USERNAME: "__token__"
FLIT_PASSWORD: ${{ secrets.PYPI_DEPLOY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- run: flit build
- run: flit publish