Skip to content

Use pydantic to validate config schema (#10) #35

Use pydantic to validate config schema (#10)

Use pydantic to validate config schema (#10) #35

name: Quality Assurance
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
permissions:
contents: read
concurrency:
group: quality-assurance-${{ github.ref }}
cancel-in-progress: true
jobs:
quality-assurance:
name: Check Code Quality
timeout-minutes: 10
runs-on: ubuntu-22.04
env:
CI_IMAGE_TAG: ghcr.io/${{ github.repository }}:ci-run-${{ github.run_id }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
show-progress: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get UID/GID of GitHub Action user
shell: bash
id: user-id
run: |
echo "gha_uid=$(id -u)" >> $GITHUB_OUTPUT
echo "gha_gid=$(id -g)" >> $GITHUB_OUTPUT
- name: Build image
uses: docker/build-push-action@v5
id: build-and-push
with:
context: .
target: ci
build-args: |
ARCHIVIST_UID=${{ steps.user-id.outputs.gha_uid }}
ARCHIVIST_GID=${{ steps.user-id.outputs.gha_gid }}
file: Dockerfile
push: false
tags: ${{ env.CI_IMAGE_TAG }}
cache-from: type=gha,scope=archivist
cache-to: type=gha,mode=max,scope=archivist
load: true
- name: Check code formatting
run: docker run ${{ env.CI_IMAGE_TAG }} poe format-check
- name: Check linting
run: docker run ${{ env.CI_IMAGE_TAG }} poe lint-check
- name: Run static analysis
run: docker run ${{ env.CI_IMAGE_TAG }} poe mypy
- name: Run tests
run: docker run ${{ env.CI_IMAGE_TAG }} poe test