-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.82 KB
/
python-app.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
checks: write
pull-requests: write # only required if `comment: true` was enabled
jobs:
test-package:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# TODO: pytorch install has to be done in an extra github job: see pytorch_geometric for an example
- name: Install torch
run:
pip3 install torch==1.11.0 torchvision==0.12.0
- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .["test"]
- name: Test with pytest
run: |
pytest --junitxml=test/junit/test_report-${{ matrix.python-version }}.xml --cov-report=xml:test/junit/cov-${{ matrix.python-version }}.xml --cov=rapidflow
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: test_report-${{ matrix.python-version }}.xml
path: test/junit/test_report-${{ matrix.python-version }}.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: test/junit/test_report-${{ matrix.python-version }}.xml
- name: Publish Coverage Report
uses: orgoro/[email protected]
with:
coverageFile: test/junit/cov-${{ matrix.python-version }}.xml
token: ${{ secrets.GITHUB_TOKEN }}