Added new Feature #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} | |