Repository navigation
91 lines (71 loc) · 2.32 KB
/
Copy pathci.yml
File metadata and controls
91 lines (71 loc) · 2.32 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v7.1.0
with:
python-version-file: .python-version
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
with:
version: 0.13.1
- name: Install dependencies
run: uv sync --locked --extra dev
- name: Install actions-lock extension
run: gh extension install github/gh-actions-lock --pin v0.4.1
- name: Verify workflow dependencies
env:
GH_TOKEN: ${{ github.token }}
run: gh actions-lock --verify
- name: Validate commit messages
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: uv run --locked --extra dev python scripts/check_commit_messages.py "$BASE_SHA" "$HEAD_SHA" --title "$PR_TITLE"
- name: Run prek
run: uv run --locked --extra dev prek run --all-files
- name: Run tests
run: uv run --locked --extra dev pytest --cov=pyhems --cov-report=xml
- name: Audit dependencies
run: uv audit --locked
- name: Upload coverage
uses: codecov/codecov-action@v7.1.1
with:
files: coverage.xml
fail_ci_if_error: false
- name: Build package
run: uv build
- name: Check distributions
run: uv run --locked --extra dev twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: dist
path: dist/
- name: Set up Go
uses: actions/setup-go@v7.0.0
with:
go-version: 1.25.0
- name: Install actionlint
run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.7
- name: Lint workflows
run: actionlint