Repository navigation
147 lines (140 loc) · 4.66 KB
/
Copy pathquality_check.yml
File metadata and controls
147 lines (140 loc) · 4.66 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Quality check - check code
# PROCESS
#
# 1. Run formatting, linting, security and complexity checks once
# 2. Run both type checkers and the test suite on every supported Python version
# 3. Validate optional dependencies with Nox on every supported Python version
# 4. Collect and report on test coverage
# USAGE
#
# Always triggered on new PRs, PR changes and PR merge.
on:
pull_request:
paths:
- "aws_lambda_powertools/**"
- "tests/**"
- "layer_v3/docker/**"
- "layer_v3/layer/canary/**"
- "examples/**"
- "pyproject.toml"
- "uv.lock"
- "mypy.ini"
- "Makefile"
- "noxfile.py"
- "ruff.toml"
- "bandit.baseline"
- ".pre-commit-config.yaml"
- ".github/workflows/quality_check.yml"
- ".github/workflows/release-v3.yml"
- ".github/workflows/pre-release.yml"
- ".github/actions/seal/**"
- ".github/actions/seal-restore/**"
branches:
- develop
push:
paths:
- "aws_lambda_powertools/**"
- "tests/**"
- "layer_v3/docker/**"
- "layer_v3/layer/canary/**"
- "examples/**"
- "pyproject.toml"
- "uv.lock"
- "mypy.ini"
- "Makefile"
- "noxfile.py"
- "ruff.toml"
- "bandit.baseline"
- ".pre-commit-config.yaml"
- ".github/workflows/quality_check.yml"
- ".github/workflows/release-v3.yml"
- ".github/workflows/pre-release.yml"
- ".github/actions/seal/**"
- ".github/actions/seal-restore/**"
branches:
- develop
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
static_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
cache-suffix: static-checks
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install dependencies
run: make dev-quality-code
- name: Check formatting
run: make format-check
- name: Lint
run: make lint-check
- name: Security baseline
run: make security-baseline
- name: Complexity baseline
run: make complexity-baseline
quality_check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
env:
PYTHON: "${{ matrix.python-version }}"
permissions:
contents: read # checkout code only
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: "0.12.19"
enable-cache: true
cache-suffix: quality-${{ matrix.python-version }}
cache-dependency-glob: |
pyproject.toml
uv.lock
noxfile.py
- name: Install dependencies
run: make dev-quality-code
- name: Cache mypy analysis
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-${{ runner.arch }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('uv.lock', 'pyproject.toml', 'mypy.ini') }}-${{ github.sha }}
restore-keys: |
mypy-${{ runner.os }}-${{ runner.arch }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('uv.lock', 'pyproject.toml', 'mypy.ini') }}-
- name: Static type checking (mypy)
run: make mypy
- name: Static type checking (ty)
run: make ty
- name: Test with pytest
run: make test
- name: Test dependencies with Nox
run: make test-dependencies
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # 7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: PYTHON
name: aws-lambda-powertools-python-codecov