Skip to content

Run Tests

Run Tests #11

Workflow file for this run

name: Run Tests
on:
workflow_dispatch:
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install ChromeDriver
uses: nanasess/setup-chromedriver@v2
- name: Install the necessary packages
run: pip install .[test]
- name: Run tests
run: pytest --cov-report xml:reports/coverage.xml --cov=stretchable --junit-xml reports/pytest.xml --html=reports/pytest.html --self-contained-html tests/
continue-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: reports/*
- name: Generate badges
run: |
pip install genbadge defusedxml
genbadge tests --input-file ./reports/pytest.xml --output-file ./stretchable-tests.svg
genbadge coverage --input-file ./reports/coverage.xml --output-file ./stretchable-coverage.svg
if: github.ref == 'refs/heads/main'
- name: Upload test results badge to gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.GIST_TOKEN }}
gist_id: 901f1f1190ba5aff13164ede9d4c249f
file_path: stretchable-tests.svg
if: github.ref == 'refs/heads/main'
- name: Upload coverage badge to gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.GIST_TOKEN }}
gist_id: b121474745d15f92a295a0bdd7497529
file_path: stretchable-coverage.svg
if: github.ref == 'refs/heads/main'