mirror of
https://github.com/Paillat-dev/esc-dramatic-unpause.git
synced 2026-01-02 01:06:21 +00:00
Add CI and quality check workflows for automated testing and validation
This commit is contained in:
17
.github/workflows/CI.yaml
vendored
Normal file
17
.github/workflows/CI.yaml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master", "dev" ]
|
||||||
|
# Publish semver tags as releases.
|
||||||
|
tags: [ 'v*.*.*' ]
|
||||||
|
pull_request:
|
||||||
|
branches: ["master", "dev"]
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
quality:
|
||||||
|
uses: ./.github/workflows/quality.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
79
.github/workflows/quality.yaml
vendored
Normal file
79
.github/workflows/quality.yaml
vendored
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
name: Quality Checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-license-header:
|
||||||
|
name: License Header Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup Copywrite
|
||||||
|
uses: hashicorp/setup-copywrite@5e3e8a26d7b9f8a508848ad0a069dfd2f7aa5339
|
||||||
|
- name: Check Header Compliance
|
||||||
|
run: copywrite headers --plan --config .copywrite.hcl
|
||||||
|
|
||||||
|
tests:
|
||||||
|
name: Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: "Set up Python"
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.12
|
||||||
|
|
||||||
|
- name: "Install uv"
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: uv sync --no-managed-python --no-python-downloads
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: uv run pytest ./tests
|
||||||
|
|
||||||
|
quality:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
check: [format, lint, basedpyright]
|
||||||
|
include:
|
||||||
|
- check: format
|
||||||
|
name: "Format Check"
|
||||||
|
command: "uv run ruff format --check ."
|
||||||
|
- check: lint
|
||||||
|
name: "Lint Check"
|
||||||
|
command: "uv run ruff check ."
|
||||||
|
- check: basedpyright
|
||||||
|
name: "Type Check"
|
||||||
|
command: "uv run basedpyright ."
|
||||||
|
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: "Install uv"
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
|
||||||
|
- name: "Set up Python"
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version-file: "pyproject.toml"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: uv sync
|
||||||
|
|
||||||
|
- name: ${{ matrix.name }}
|
||||||
|
run: ${{ matrix.command }}
|
||||||
Reference in New Issue
Block a user