Skip to content

Minimal readme + acknowledgement (#7) #32

Minimal readme + acknowledgement (#7)

Minimal readme + acknowledgement (#7) #32

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled"
required: false
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflows that are still running
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout latest commit
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history with version tags
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Set up pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
- name: Set up environment
run: |
pip install --upgrade pip wheel setuptools
pip install bandit[toml]==1.7.4 ruff==0.5.5
- name: Linting check
run: |
bandit -qr -c pyproject.toml src/
ruff check src/ tests/
ruff format --check src/ tests
unit-tests:
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: password
options: >-
--health-cmd "pg_isready -d postgres://test:password@localhost:5432"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
env:
PIP_CACHE_DIR: .cache/pip
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
steps:
- name: Cancel previous workflows that are still running
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout latest commit
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history with version tags
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up pip cache
uses: actions/cache@v2
with:
path: .cache/pip
key: ${{ matrix.tox-env }}-${{ matrix.os }}
- name: Set up environment
run: |
pip install --upgrade pip
pip install mypy==1.8.0
pip install -e ".[dev]"
- name: Running mypy and tests
run: |
mypy src/
pytest --color=yes