File: ci.yaml

package info (click to toggle)
python-go2rtc-client 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 788 kB
  • sloc: python: 1,127; makefile: 3
file content (86 lines) | stat: -rw-r--r-- 2,876 bytes parent folder | download
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
---
name: CI

# yamllint disable-line rule:truthy
on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

jobs:
  pre-commit:
    name: pre-commit
    runs-on: ubuntu-latest
    env:
      PRE_COMMIT_HOME: /tmp/pre-commit-cache
    steps:
      - name: โคต๏ธ Check out code from GitHub
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - name: ๐Ÿ— Set up uv
        uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
        with:
          enable-cache: true
      - name: ๐Ÿ— Set pre-commit cache
        uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
        with:
          path: ${{ env.PRE_COMMIT_HOME }}
          key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml','.python-version') }}
      - name: ๐Ÿš€ Run pre-commit
        env:
          # Skipping branch check and pytest as pytest is run in a separate job
          SKIP: no-commit-to-branch,pytest
        run: uv run --frozen pre-commit run -a

  pytest:
    name: pytest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python: ["3.12", "3.13", "3.14"]
    steps:
      - name: โคต๏ธ Check out code from GitHub
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - name: ๐Ÿ— Set up uv
        uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
        with:
          enable-cache: true
      - name: ๐Ÿ— Set up Python ${{ matrix.python }}
        run: uv python install ${{ matrix.python }}
      - name: ๐Ÿ— Install dependencies
        run: uv sync --frozen --dev
      - name: ๐Ÿš€ Run pytest
        run: uv run pytest --cov go2rtc_client tests
      - name: โฌ†๏ธ Upload coverage artifact
        uses: actions/upload-artifact@v6.0.0
        with:
          include-hidden-files: true
          name: coverage-${{ matrix.python }}
          path: .coverage

  coverage:
    runs-on: ubuntu-latest
    needs: pytest
    steps:
      - name: โคต๏ธ Check out code from GitHub
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          fetch-depth: 0
      - name: โฌ‡๏ธ Download coverage data
        uses: actions/download-artifact@v7.0.0
      - name: ๐Ÿ— Set up uv
        uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
        with:
          enable-cache: true
      - name: ๐Ÿ— Install dependencies
        run: uv sync --frozen --dev
      - name: ๐Ÿš€ Process coverage results
        run: |
          uv run --frozen coverage combine coverage*/.coverage*
          uv run --frozen coverage xml -i
      - name: โฌ†๏ธ Upload coverage report
        uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
        with:
          fail_ci_if_error: true
          token: ${{ secrets.CODECOV_TOKEN }}