-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (81 loc) · 2.08 KB
/
Copy pathpython-ci.yaml
File metadata and controls
84 lines (81 loc) · 2.08 KB
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
name: CI/CD for simple-http-checker
on:
push:
branches: ['main']
workflow_dispatch:
jobs:
lint-static-checks:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Display Python version and location
run: |
python --version
which python
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Linting and format checks
run: |
ruff check .
black --check .
- name: Static type checks
run: |
mypy src/
- name: Security checks
run: |
bandit -c pyproject.toml -r .
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Automated tests with Pytest
run: |
pytest
build-and-upload:
runs-on: ubuntu-latest
needs:
- tests
- lint-static-checks
permissions:
contents: write
id-token: write
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release
- name: Create release
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
semantic-release version
semantic-release publish