-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (50 loc) · 1.36 KB
/
python-tests.yaml
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
49
50
51
name: Python tests
on:
pull_request:
push:
branches:
- main
jobs:
python-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# https://devguide.python.org/versions
python-version: ["3.9", "3.10", "3.11", "3.12"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r .devcontainer/requirements-dev.txt
- name: Run tests
run: |
coverage run --branch --include="src/fish_ai/*.py" -m pytest
coverage xml
coverage report
- name: Report code coverage
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'pre-commit-ci[bot]'
uses: orgoro/coverage@v3.2
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Python test results
needs: [python-tests]
steps:
- run: |
result="${{ needs.python-tests.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi