Skip to content

lint

lint #20

Workflow file for this run

---
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.1
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version-file: '.python-version'
- run: pip install -U pip-tools
- run: pip-sync dev-requirements.txt requirements.txt
- name: Lint
id: lint
run: make lint ARGS=--output-format=github
- name: Run tests
id: test
env:
DATABASE_URL: postgres://postgres:@localhost:5432/postgres
run: make test ARGS="--doctest-modules --junitxml=junit/test-results.xml"
- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: junit/test-results.xml
if: ${{ always() }}
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: string
uses: ASzc/change-string-case-action@v5
with:
string: ghcr.io/${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.string.outputs.lowercase }}
${{ steps.string.outputs.lowercase }}/${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max