File: test.yml

package info (click to toggle)
posting 2.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,556 kB
  • sloc: python: 9,719; makefile: 15
file content (50 lines) | stat: -rw-r--r-- 1,442 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
name: Continuous Integration

on:
    pull_request:
    push:
      branches:
        - "main"

env:
    PYTEST_ADDOPTS: "--color=yes"

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      - name: Install a specific version of uv
        uses: astral-sh/setup-uv@v5
        with:
          version: "0.6.3"
          enable-cache: true
      - run: uv python install  # Will read from .python-version
      - name: Install Dependencies
        run: uv sync --all-extras --dev
      - name: Run Tests
        run: |
            uv run make test-ci
      - name: Attach Code Coverage
        uses: py-cov-action/python-coverage-comment-action@v3.25
        with:
            GITHUB_TOKEN: ${{ github.token }}

      - name: Save Snapshot Report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: snapshot-report-posting
          path: snapshot_report.html
    
      - name: Store Pull Request Comment
        uses: actions/upload-artifact@v4
        if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
        with:
            # If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
            name: python-coverage-comment-action
            # If you use a different name, update COMMENT_FILENAME accordingly
            path: python-coverage-comment-action.txt