build(deps-dev): bump ruff from 0.0.292 to 0.1.1 #60
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: {} | |
permissions: | |
contents: read | |
env: | |
POETRY_VERSION: "1.3.1" | |
MINIMUM_PYTHON_VERSION: "3.10" | |
jobs: | |
lint: | |
name: ${{ matrix.task.name }} (${{ matrix.os }}) | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
# Only run checks for ubuntu | |
os: [ubuntu] | |
task: | |
- name: Lint code | |
run: make lint | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Monitor actions permissions | |
uses: GithubSecurityLab/actions-permissions/monitor@fc99d70db4fb9c0443f50f248c2b3590948d0b9b | |
with: | |
config: ${{ vars.PERMISSIONS_CONFIG }} | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ env.MINIMUM_PYTHON_VERSION }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/ci.yml')}} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry install --no-interaction --no-root | |
poetry install --only ci | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# Run matrix task | |
#---------------------------------------------- | |
- name: ${{ matrix.task.name }} | |
run: ${{ matrix.task.run }} | |
check-fmt: | |
name: ${{ matrix.task.name }} (${{ matrix.os }}) | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
# Only run checks for ubuntu | |
os: [ubuntu] | |
task: | |
- name: Check formatting | |
run: make check-fmt | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Monitor actions permissions | |
uses: GithubSecurityLab/actions-permissions/monitor@fc99d70db4fb9c0443f50f248c2b3590948d0b9b | |
with: | |
config: ${{ vars.PERMISSIONS_CONFIG }} | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ env.MINIMUM_PYTHON_VERSION }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/ci.yml')}} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry install --no-interaction --no-root | |
poetry install --only ci | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# Run matrix task | |
#---------------------------------------------- | |
- name: ${{ matrix.task.name }} | |
run: ${{ matrix.task.run }} | |
type-check: | |
name: ${{ matrix.task.name }} (${{ matrix.os }}) | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
# Only run checks for ubuntu | |
os: [ubuntu] | |
task: | |
- name: Type check | |
run: make type-check | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Monitor actions permissions | |
uses: GithubSecurityLab/actions-permissions/monitor@fc99d70db4fb9c0443f50f248c2b3590948d0b9b | |
with: | |
config: ${{ vars.PERMISSIONS_CONFIG }} | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ env.MINIMUM_PYTHON_VERSION }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/ci.yml')}} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry install --no-interaction --no-root | |
poetry install --only ci | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# Run matrix task | |
#---------------------------------------------- | |
- name: ${{ matrix.task.name }} | |
run: ${{ matrix.task.run }} | |
coverage: | |
name: Test coverage py-${{ matrix.python-version }} on ${{ matrix.os }} | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
# ignore windows for now | |
os: [ubuntu] # , macos, windows-latest] | |
python-version: | |
- "3.10" | |
- "3.11" | |
- "3.12-dev" | |
continue-on-error: >- | |
${{ contains(matrix.python-version, 'dev') && true || false }} | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Monitor actions permissions | |
uses: GithubSecurityLab/actions-permissions/monitor@fc99d70db4fb9c0443f50f248c2b3590948d0b9b | |
with: | |
config: ${{ vars.PERMISSIONS_CONFIG }} | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/ci.yml') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry install --no-interaction --no-root | |
poetry install --only ci | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# Run tests and upload coverage | |
#---------------------------------------------- | |
- name: Run tests for coverage | |
run: make cov_report=xml test-w-coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# directory: ./coverage/reports/ | |
# env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
# files: ./coverage1.xml,./coverage2.xml | |
# flags: unittests | |
# name: codecov-umbrella | |
verbose: true | |
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | |
check: | |
if: always() | |
needs: [lint, coverage, type-check, check-fmt] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Monitor actions permissions | |
uses: GithubSecurityLab/actions-permissions/monitor@fc99d70db4fb9c0443f50f248c2b3590948d0b9b | |
with: | |
config: ${{ vars.PERMISSIONS_CONFIG }} | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
allowed-failures: type-check, lint | |