aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/main.yml
blob: c738ed5f8e81ac1e3a263957eeb7bbb475fe0058 (plain)
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
name: Test and Report Coverage

on:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.13'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install poetry
          poetry install

      - name: Run tests with pytest-cov
        run: |
          poetry run pytest --cov=./ --cov-report=xml:coverage.xml

      - name: Report results to DeepSource
        env:
          DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
        run: |
          curl https://deepsource.io/cli | sh
          ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
git.ajschof.me — hosted by ajschofield — powered by cgit