generated from SevanSSP/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.6 KB
/
test.yml
File metadata and controls
60 lines (48 loc) · 1.6 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
name: Tests
on:
# Workflow dispatch is used for manual triggers
workflow_dispatch:
# Workflow call is used for called from another workflow
workflow_call:
push:
branches:
- main
pull_request:
env:
UV_INDEX_REPOFORGE_USERNAME: ${{ secrets.PACKAGR_USERNAME }}
UV_INDEX_REPOFORGE_PASSWORD: ${{ secrets.PACKAGR_PASSWORD }}
jobs:
pre-commit: # Static analyzers, formatters and verifying pre-commit hooks has been run
name: Build & Run Pre Commit hooks to verify code structure, quality etc. from pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: "Setup: checkout repository"
uses: actions/checkout@v4
- name: "Setup: add python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: "Run: pre-commit"
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
test:
name: Test with ${{matrix.python-version}} on Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Test with python ${{ matrix.python-version }}
run: uv run coverage run -m pytest
- name: Get Test Coverage score
id: total
if: matrix.python-version == '3.12'
run: |
uv run coverage report --include=src/\* --fail-under=95 -m