Blob input #233
Workflow file for this run
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: | |
- pull_request | |
jobs: | |
base_coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install Dependencies | |
run: pip install -e .[dev,server] | |
- name: Test with pytest | |
run: | | |
pytest --cov=src --cov-report=lcov | |
mv coverage.lcov base-coverage.lcov | |
- name: Upload code coverage for base branch | |
uses: actions/upload-artifact@v3 | |
with: | |
name: base-coverage.lcov | |
path: ./base-coverage.lcov | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Dependencies | |
run: pip install -e .[dev,server] | |
- name: Lint with Ruff | |
run: ruff check . | |
- name: Format with Ruff | |
run: ruff format --check . | |
- name: Test with pytest | |
run: pytest --cov=src --cov-report=lcov | |
- name: Upload code coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage.lcov | |
path: ./coverage.lcov | |
- name: Analyse with MyPy | |
run: mypy src | |
coverage: | |
runs-on: ubuntu-latest | |
needs: [base_coverage, test] | |
steps: | |
- name: Download code coverage report | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage.lcov | |
- name: Download code coverage report for base branch | |
uses: actions/download-artifact@v3 | |
with: | |
name: base-coverage.lcov | |
- name: Generate Code Coverage report | |
id: code-coverage | |
uses: barecheck/code-coverage-action@v1 | |
with: | |
barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }} | |
lcov-file: "./coverage.lcov" | |
base-lcov-file: "./base-coverage.lcov" | |
minimum-ratio: 0 | |
send-summary-comment: true | |
show-annotations: "warning" |