Skip to content

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.1.7 #126

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.1.7

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.1.7 #126

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- main
jobs:
linting:
name: "Linting and formatting checks"
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "3.11"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: "Run black"
run: |
poetry run pre-commit run black --all-files
- name: "Run ruff"
uses: chartboost/ruff-action@v1
tests:
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}"
needs: linting
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: "Run tests"
run: |
poetry run pytest --cov aioelectricitymaps --cov-report xml
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v3"
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}