-
Notifications
You must be signed in to change notification settings - Fork 22
96 lines (89 loc) · 2.53 KB
/
ci.yml
File metadata and controls
96 lines (89 loc) · 2.53 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
name: CI
on:
push:
branches: [main, develop]
tags: ["v*"]
pull_request:
branches: [main, develop]
workflow_call:
inputs:
python-version:
required: false
type: string
default: '3.12'
skip-tests:
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ inputs.python-version || '3.12' }}
- run: uv run ruff format --check src/celeste tests/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ inputs.python-version || '3.12' }}
- run: uv run ruff check --output-format=github src/celeste tests/
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ inputs.python-version || '3.12' }}
- run: uv run mypy -p celeste && uv run mypy tests/
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ inputs.python-version || '3.12' }}
- run: uv run bandit -c pyproject.toml -r src/ -f screen
test:
if: ${{ !inputs.skip-tests }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
os: [ubuntu-latest]
include:
- python-version: "3.12"
os: windows-latest
- python-version: "3.12"
os: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --extra gcp
- run: uv run pytest tests/unit_tests -v --cov=celeste --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=80
- uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false