-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (41 loc) · 1.34 KB
/
test.yml
File metadata and controls
41 lines (41 loc) · 1.34 KB
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
---
name: Test
on: # yamllint disable-line rule:truthy
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
# yamllint disable-line rule:line-length
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
# yamllint disable-line rule:line-length
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
- name: Cache NLTK data
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ~/nltk_data
key: nltk-averaged-perceptron-tagger-punkt
- name: Run tests with coverage
run: |-
uv run --dev pytest \
tests/ --cov=git_commit_guard --cov-report=term-missing \
--cov-report=xml
- name: Save coverage artifact
env:
PR_NUMBER: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo "$PR_NUMBER" > ./pr/NR
cp coverage.xml ./pr/
- name: Upload PR artifact
# yamllint disable-line rule:line-length
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
with:
name: pr
path: pr/