-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (65 loc) · 2.04 KB
/
pythonapp.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
name: Python application
on: [push, pull_request]
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install system dependancies
run: |
sudo apt-get update
sudo apt-get install slapd ldap-utils
- name: Remove apparmor restrictions on slapd
run: |
sudo apt-get install apparmor-utils
sudo aa-complain /usr/sbin/slapd
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install poetry
uses: abatilo/actions-poetry@v4.0.0
with:
poetry-version: 1.3.0
- name: Install python dependancies
run: |
poetry install --extras=docs
- name: Run tests
run: |
export TZ=Australia/Melbourne
poetry run make -C docs html
poetry run isort --check --diff tldap
poetry run flake8 tldap
poetry run python -m tldap.test.slapd python -m pytest --cov=tldap --junitxml=test-reports/junit.xml
publish-pypi-prod:
name: Publish Pypi Prod
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install poetry
uses: abatilo/actions-poetry@v4.0.0
with:
poetry-version: 1.3.0
- name: Install python dependancies
run: |
poetry install
- name: Verify git tag vs. version
run: |
VERSION=${GITHUB_REF#refs/tags/}
test "$(poetry version)" = "python-tldap ${VERSION}"
- name: Create packages
run: |
poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_PASSWORD }}