[pre-commit.ci] auto fixes from pre-commit.com hooks #350
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: lint and test | |
on: push | |
env: | |
POETRY_VERSION: 1.3.1 | |
POETRY_VIRTUALENVS_IN_PROJECT: true | |
jobs: | |
lint-n-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load cached Poetry installation | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: poetry-${{ env.POETRY_VERSION }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Cache Packages | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Cache pre-commit environment | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache | |
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/.pre-commit-config.yaml') }} | |
- name: Install Dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Run pre-commit hooks | |
run: poetry run pre-commit run --all-files | |
- name: Run tests | |
run: poetry run pytest tests --cov-report xml:cov.xml --cov rustshed | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./cov.xml |