chore: update readme (#1462) #158
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Ruff | |
run: pip install ruff | |
- name: Lint code with Ruff | |
run: ruff check --output-format=github --target-version=py39 . | |
continue-on-error: false # TODO: delete once ruff errors are fixed | |
# - name: Check code formatting with Ruff | |
# run: ruff format --check . | |
# continue-on-error: false # TODO: delete once ruff errors are fixed | |
build: | |
needs: lint | |
runs-on: ubuntu-latest | |
env: | |
PROXY: "http://51.83.140.52:16301" | |
strategy: | |
matrix: | |
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checking env | |
run: | | |
echo "PROXY: $PROXY" | |
env | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest pytest-cov pyright tox | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi | |
- name: Type check with pyright | |
run: pyright | |
- name: Test with tox | |
run: tox -e py | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@v2 | |
with: | |
flag-name: run-${{ join(matrix.*, '-') }} | |
parallel: true | |
finish: | |
needs: build | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true |