-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (40 loc) · 1.23 KB
/
build.yml
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
name: Build
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions:
contents: read
jobs:
build-and-test:
name: Build project and run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
- name: Install dependencies
run: |
uv sync --dev
- name: Lint with Ruff
run: |
uv run ruff check src/ tests/
- name: Static code analysis with pylint
run: |
uv run pylint src/ tests/
- name: Test with pytest
run: |
uv run pytest --cov=smartwatts --cov-report=term --cov-report=xml tests/unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml