fix: removed coverage.json file, updated version and coverage badge to work #179
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: build | |
# Use more columns for terminal output | |
env: | |
COLUMNS: 120 | |
PYTHONIOENCODING: utf8 | |
# Controls when the action will run | |
# Workflow begins with push or PR events | |
# Focuses on the master branch only | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Create one single job | |
# This job performs all of the necessary checks | |
jobs: | |
build: | |
# Use the latest version of Ubuntu, MacOS, and Windows | |
# Use the latest and most stable version of Python | |
# Important: test coverage monitoring and reporting | |
# through a badge and the GitHub Actions job summary | |
# only takes place with the Linux operating system. | |
# Important: the MacOS and Windows operating systems | |
# have test coverage calculation take place but they | |
# do not report the test coverage beyond its display | |
# inside of the GitHub Actions panel for that job. | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.12"] | |
include: | |
- os: macos-latest | |
python-version: "3.12" | |
- os: windows-latest | |
python-version: "3.12" | |
# Define the workflow steps | |
steps: | |
# Checkout the code of the repository | |
- name: Check out Repository Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Setup Python for the current language version | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Install pip | |
- name: Install Pip | |
run: | | |
python -m pip install --upgrade pip | |
# Install poetry | |
- name: Install Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.8.3 | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
poetry install | |
# Run the linters | |
- name: Run Linters | |
run: | | |
pipx install ruff | |
poetry run task lint | |
# Run the tests | |
- name: Run Tests | |
run: | | |
poetry run task test-not-fuzz | |
# Run coverage | |
- name: Run Coverage | |
run: poetry run pytest --cov=. --cov-report=term | |
# Run the tests and update badges | |
- name: Run Tests and Update Badges | |
run: poetry run python scripts/badges.py | |
# Generate badges | |
- name: Generate Coverage and Version Badges | |
run: | | |
poetry run python scripts/badges.py | |
- name: Commit updated README.md | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git checkout main # Ensure you're on the main branch | |
git add README.md | |
git commit -m "Update badges in README.md" || echo "No changes to commit" | |
git push origin main | |