-
Notifications
You must be signed in to change notification settings - Fork 9
93 lines (87 loc) · 2.4 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
name: CI
on:
push:
branches:
- master
tags:
- v** # Run on all version tags
pull_request:
jobs:
pytest:
name: pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
django: ["3.2.16", "4.0.8", "4.1.4" ]
exclude:
# Excludes Python 3.11 for Django < 4.1
- python: "3.11"
django: "3.2.16"
- python: "3.11"
django: "4.0.8"
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 1s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
- run: pip install --upgrade pip
- run: pip install poetry
- run: poetry config --local virtualenvs.in-project true
- run: poetry install
- run: pip install -U django==${{ matrix.django }}
- run: PGPASSWORD=postgres psql -c 'create database tests;' -U postgres -h localhost -p 5432
- run: poetry run ./bin/test
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
publish:
if: startsWith(github.event.ref, 'refs/tags')
name: publish
needs: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64
- run: pip install --upgrade pip
- run: pip install poetry
- run: poetry build
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password_test }}
repository_url: https://test.pypi.org/legacy/
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
Changes:
- ...
- ...
draft: true
prerelease: false