-
-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (97 loc) · 3.53 KB
/
python_ci_linux.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
# This file is managed by 'repo_helper'. Don't edit it directly.
---
name: Linux
on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
tags:
- '*'
pull_request:
permissions:
actions: write
issues: write
contents: read
jobs:
tests:
name: "ubuntu-20.04 / Python ${{ matrix.config.python-version }}"
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.13.0-beta.4'
strategy:
fail-fast: False
matrix:
config:
- {python-version: "3.6", testenvs: "py36,build", experimental: False}
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
- {python-version: "3.13.0-beta.4", testenvs: "py313-dev,build", experimental: True}
steps:
- name: Checkout 🛎️
uses: "actions/checkout@v4"
- name: Check for changed files
if: startsWith(github.ref, 'refs/tags/') != true
uses: dorny/paths-filter@v2
id: changes
with:
list-files: "json"
filters: |
code:
- '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)'
- name: Setup Python 🐍
id: setup-python
if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }}
uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.config.python-version }}"
- name: Install dependencies 🔧
if: steps.setup-python.outcome == 'success'
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox~=3.0 virtualenv!=20.16.0
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
if: steps.setup-python.outcome == 'success'
run: python -m tox -e "${{ matrix.config.testenvs }}" -s false
Deploy:
needs: tests
runs-on: "ubuntu-20.04"
steps:
- name: Checkout 🛎️
uses: "actions/checkout@v4"
if: startsWith(github.ref, 'refs/tags/')
- name: Setup Python 🐍
uses: "actions/setup-python@v5"
if: startsWith(github.ref, 'refs/tags/')
with:
python-version: 3.8
- name: Install dependencies 🔧
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox~=3.0
- name: Build distributions 📦
if: startsWith(github.ref, 'refs/tags/')
run: |
tox -e build
- name: Upload distribution to PyPI 🚀
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
- name: Close milestone 🚪
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade github3.py packaging
python .github/milestones.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}