tests on virtuoso #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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Copyright 2024 Arcangelo Massari <[email protected]> | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any purpose | |
# with or without fee is hereby granted, provided that the above copyright notice | |
# and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | |
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, | |
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, | |
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS | |
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
# SOFTWARE. | |
name: Run tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
CheckCoverage: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip3 install poetry | |
sudo apt install -y python-is-python3 | |
poetry install | |
sudo apt install -y libncurses5 | |
- name: Run Virtuoso | |
run: | | |
cd virtuoso-opensource/bin | |
./virtuoso-t | |
python3 -c 'import time; time.sleep(15)' | |
cd ../.. | |
- name: Check the overage | |
run: | | |
poetry run coverage run --rcfile=test/coverage/.coveragerc | |
- name: Generate the badge | |
run: | | |
mv .coverage test/coverage/ | |
cd test/coverage/ | |
rm coverage.svg | |
poetry run coverage-badge -o coverage.svg | |
- uses: actions/upload-artifact@v3.1.0 | |
with: | |
name: coverage-artifact | |
path: test/coverage/ | |
PublishBadge: | |
runs-on: ubuntu-latest | |
needs: CheckCoverage | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
- uses: actions/download-artifact@v3.0.0 | |
with: | |
name: coverage-artifact | |
path: test/coverage/ | |
- name: Publish the badge on the GitHub repo | |
run: | | |
git pull | |
git add test/coverage/.coverage | |
git add test/coverage/coverage.svg | |
git config --global user.name 'arcangelo7' | |
git config --global user.email '[email protected]' | |
git commit -m 'Coverage updated' | |
git push |