Skip to content

add lint step

add lint step #1

Workflow file for this run

---
name: CI
on:
pull_request:
branches:
- dev
- master
push:
branches:
- dev
- master
jobs:
lint-ruff-format:
name: Check ruff-format
runs-on: ubuntu-22.04
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python 3.x
uses: actions/[email protected]
id: python
with:
python-version: 3.x
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/[email protected]
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Run ruff-format
run: |
. venv/bin/activate
pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
python -m venv venv
venv/bin/pip install -r requirements_test.txt
venv/bin/py.test tests/
coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
architecture: x64
- run: |
python -m venv venv
venv/bin/pip install -r requirements_test.txt
venv/bin/py.test \
-s \
--verbose \
--cov-report term-missing \
--cov-report xml \
--cov=pyseventeentrack tests
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}