forked from inno-devops-labs/DevOps-Core-Course
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.54 KB
/
python-ci.yml
File metadata and controls
56 lines (54 loc) · 1.54 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
name: Python CI
on:
push:
paths:
- app_python/**
- .github/actions/python-setup/**
- .github/workflows/python-ci.yml
pull_request:
branches:
- master
paths:
- app_python/**
- .github/actions/python-setup/**
- .github/workflows/python-ci.yml
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [3.14]
uv-version: [0.11.14]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./app_python
steps:
- uses: actions/checkout@v6
- name: Setup Python tooling and dependencies
uses: ./.github/actions/python-setup
with:
python-version: ${{ matrix.python-version }}
uv-version: ${{ matrix.uv-version }}
working-directory: app_python
lockfile-path: app_python/uv.lock
install-args: --locked
- name: Lint with flake8
run: uv run flake8 src tests
- name: Test using pytest with coverage report
run: |
mkdir -p test-results
uv run pytest \
--junitxml=test-results/pytest-report.xml \
--cov=src \
--cov-report=term-missing \
--cov-report=xml:test-results/coverage.xml
- name: Upload pytest and coverage reports
if: always()
uses: actions/upload-artifact@v7
with:
name: python-test-reports
path: |
app_python/test-results/pytest-report.xml
app_python/test-results/coverage.xml