File: action.yml

package info (click to toggle)
python-fakeredis 2.29.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,820 kB
  • sloc: python: 18,993; sh: 8; makefile: 5
file content (48 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (2)
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
name: 'Run test with coverage'
description: 'Greet someone'
inputs:
  github-secret:
    description: 'GITHUB_TOKEN'
    required: true
  gist-secret:
    description: 'gist secret'
    required: true
runs:
  using: "composite"
  steps:
    - name: Test with coverage
      shell: bash
      run: |
        poetry run ruff check
        poetry run pytest -v --cov=fakeredis --cov-branch
        poetry run coverage json
        echo "COVERAGE=$(jq '.totals.percent_covered_display|tonumber' coverage.json)" >> $GITHUB_ENV
    - name: Create coverage badge
      if: ${{ github.event_name == 'push' }}
      uses: schneegans/dynamic-badges-action@v1.7.0
      with:
        auth: ${{ inputs.gist-secret }}
        gistID: b756396efb895f0e34558c980f1ca0c7
        filename: fakeredis-py.json
        label: coverage
        message: ${{ env.COVERAGE }}%
        color: green
    - name: Coverage report
      if: ${{ github.event_name == 'pull_request' }}
      id: coverage_report
      shell: bash
      run: |
        echo 'REPORT<<EOF' >> $GITHUB_ENV
        poetry run coverage report >> $GITHUB_ENV
        echo 'EOF' >> $GITHUB_ENV
    - uses: mshick/add-pr-comment@v2
      if: ${{ github.event_name == 'pull_request' }}
      with:
        message: |
          Coverage report:
          ```
          ${{ env.REPORT }}
          ```
        repo-token: ${{ inputs.github-secret }}
        allow-repeats: false
        message-id: coverage