Merge branch 'master' of https://github.com/intsystems/graphical-mode… #5
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
name: test | |
on: | |
workflow_dispatch: | |
# uncomment to make it runnable after each push into master | |
push: | |
branches: [ master ] | |
#pull_request: | |
# branches: [ master ] | |
jobs: | |
pytest: | |
name: pytest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.10] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.10" | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2 | |
- name: Install PyTest | |
run: | | |
sudo pip install -U "pytest>=7.2.0" "pytest-cov>=4.0.0" | |
- name: Install Dependencies | |
run: | | |
sudo pip install -U -r src/requirements.txt | |
cd src; sudo pip install . | |
sudo pip install pydantic | |
sudo pip install openai | |
- name: Testing | |
run: | | |
PYTHONPATH=src/ sudo python -m pytest tests/ --cov=code --cov-report=xml | |
pytest --cov=code --cov-report=html --cov-report=term-missing tests/ # Generate HTML report | |
- name: Upload Coverage Report to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: . # Directory where HTML report is generated | |
- name: Generate coverage badge | |
run: | | |
python src/badge_generator.py | |
- name: Commit coverage badge | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add coverage-badge.svg | |
git commit -m "Update coverage badge" | |
git push | |