-
Notifications
You must be signed in to change notification settings - Fork 11
34 lines (32 loc) · 1.06 KB
/
main.yml
File metadata and controls
34 lines (32 loc) · 1.06 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
name: Hatch Unit Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11.9"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install Hatch
run: pipx install hatch
- name: Submodule update
run: "git submodule init; git submodule update"
- name: Run tests
run: hatch run test:unit
- name: Check coverage
run: "hatch run test:coverage | grep TOTAL | python -c $'import sys\\nfor line in sys.stdin: \\n coverage = int([s for s in line.split(\" \") if s != \"\"][-1].strip()[:-1])\\n print(coverage)\\n exit(1 if coverage < 94 else 0)'"