-
Notifications
You must be signed in to change notification settings - Fork 44
executable file
·37 lines (34 loc) · 1.05 KB
/
unit-tests.yml
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
name: Python Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:
jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: quay.io/project-codeflare/codeflare-sdk-precommit:v0.0.3
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pip install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with test
- name: Test with pytest and check coverage
run: |
coverage run -m pytest
coverage=$(coverage report -m | tail -1 | tail -c 4 | head -c 2)
if (( $coverage < 90 )); then echo "Coverage failed at ${coverage}%"; exit 1; else echo "Coverage passed, ${coverage}%"; fi
continue-on-error: true
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}