-
Notifications
You must be signed in to change notification settings - Fork 1.6k
129 lines (123 loc) · 3.63 KB
/
main.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Test and release
# Fires on all incoming commits
on:
pull_request:
push:
jobs:
# Test all supported Python & Django versions
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Django 4.0
- tox-env: "py38-dj40"
python-version: "3.8"
- tox-env: "py39-dj40"
python-version: "3.9"
- tox-env: "py310-dj40"
python-version: "3.10"
- tox-env: "py311-dj40"
python-version: "3.11"
# Django 4.1
- tox-env: "py38-dj41"
python-version: "3.8"
- tox-env: "py39-dj41"
python-version: "3.9"
- tox-env: "py310-dj41"
python-version: "3.10"
- tox-env: "py311-dj41"
python-version: "3.11"
# Django 4.2
- tox-env: "py38-dj42"
python-version: "3.8"
- tox-env: "py39-dj42"
python-version: "3.9"
- tox-env: "py310-dj42"
python-version: "3.10"
- tox-env: "py311-dj42"
python-version: "3.11"
# Django 5.0
- tox-env: "py310-dj50"
python-version: "3.10"
- tox-env: "py311-dj50"
python-version: "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -U pip tox
- name: Run tests
run: tox -e ${{ matrix.tox-env }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
report_paths: '**/junit/TEST-*.xml'
# Lint
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: pip install tox -U pip
- name: Lint
run: tox -e package -e lint -e pyupgrade
# Create a new semantic release
# Only runs on the original repo, not forks
release:
if: github.repository_owner == 'stephenmcd'
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.9
- uses: actions/setup-node@v3
- uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 18
extra_plugins: |
@semantic-release/exec@6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# Build and deploy docs
docs:
if: github.ref == 'refs/heads/stable'
needs: release
name: build and deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install deps
run: pip install -e . && pip install sphinx
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
semver_only: true
- name: Get release tag
run: echo "RELEASE_TAG=${{ steps.get-latest-tag.outputs.tag }}" >> $GITHUB_ENV
- name: Build docs
run: sphinx-build -b html docs docs/build
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/build
fqdn: mezzanine.jupo.org
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}