File: tests.yaml

package info (click to toggle)
python-peblar 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 548 kB
  • sloc: python: 2,031; makefile: 3
file content (62 lines) | stat: -rw-r--r-- 1,730 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
---
name: Testing

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

env:
  DEFAULT_PYTHON: "3.11"

jobs:
  pytest:
    name: Python ${{ matrix.python }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python: ["3.11", "3.12", "3.13"]
    steps:
      - name: โคต๏ธ Check out code from GitHub
        uses: actions/checkout@v4.2.2
      - name: ๐Ÿ— Set up uv
        uses: astral-sh/setup-uv@v5.2.1
        with:
          enable-cache: true
          python-version: ${{ env.DEFAULT_PYTHON }}
      - name: ๐Ÿ— Install dependencies
        run: uv sync --extra cli --frozen --dev
      - name: ๐Ÿš€ Run pytest
        run: uv run pytest --cov peblar tests
      - name: โฌ†๏ธ Upload coverage artifact
        uses: actions/upload-artifact@v4.6.0
        with:
          name: coverage-${{ matrix.python }}
          path: .coverage
          if-no-files-found: error
          include-hidden-files: true

  coverage:
    runs-on: ubuntu-latest
    needs: pytest
    steps:
      - name: โคต๏ธ Check out code from GitHub
        uses: actions/checkout@v4.2.2
        with:
          fetch-depth: 0
      - name: โฌ‡๏ธ Download coverage data
        uses: actions/download-artifact@v4.1.8
      - name: ๐Ÿ— Set up uv
        uses: astral-sh/setup-uv@v5.2.1
        with:
          enable-cache: true
          python-version: ${{ env.DEFAULT_PYTHON }}
      - name: ๐Ÿ— Install dependencies
        run: uv sync --extra cli --frozen --dev
      - name: ๐Ÿš€ Process coverage results
        run: |
          uv run coverage combine coverage*/.coverage*
          uv run coverage xml -i
      - name: ๐Ÿš€ Upload coverage report
        uses: codecov/codecov-action@v5.2.0