-
Notifications
You must be signed in to change notification settings - Fork 22
78 lines (75 loc) · 2.24 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
name: "CI" # Note that this name appears in the README's badge
on:
push:
branches:
- master
pull_request:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
django-tox-env:
- "django32"
- "django40"
- "django42"
- "django50"
exclude:
# We don't want every combination of the above, as some are not compatible
- python-version: "3.11"
django-tox-env: "django32"
- python-version: "3.11"
django-tox-env: "django40"
- python-version: "3.9"
django-tox-env: "django50"
name: Python ${{ matrix.python-version }} + ${{ matrix.django-tox-env }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: pip install tox
- name: Run tox
run: tox -e py${{ matrix.python-version }}-${{ matrix.django-tox-env }} --skip-missing-interpreter=false
lint:
runs-on: ubuntu-latest
name: Flake 8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install test requirements
run: pip install tox flake8
- name: Run tox
run: tox -e py3.9-flake8
release:
name: django-mozilla-product-details Release
if: github.event_name == 'release' && github.event.action == 'published'
needs:
- test
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install lightest dependencies for successful packaging
run: pip install Django requests build
- name: Ensure the latest product-details json files are pulled in
run: python updatejson.py
- name: Build package for upload to PyPI
run: python -m build .
- name: Upload the distribution to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}