ci: fix and document CI
This commit is contained in:
@@ -1,26 +1,26 @@
|
|||||||
name: Docker CI
|
name: Docker CI
|
||||||
on: [push]
|
|
||||||
|
concurrency:
|
||||||
|
group: docker-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on: [push, workflow_dispatch]
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILDKIT_VERSION: 'v0.29.0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
docker-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- name: Checkout repository
|
||||||
- uses: docker/setup-buildx-action@v1
|
uses: actions/checkout@v6
|
||||||
- uses: actions/cache@v4
|
- name: Set up buildkit cache
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /var/lib/buildkit
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildkit-${{ env.BUILDKIT_VERSION }}
|
||||||
restore-keys: |
|
- name: Test docker build
|
||||||
${{ runner.os }}-buildx-
|
uses: klemek/dockerfile-test-build@v1
|
||||||
- uses: docker/build-push-action@v2
|
|
||||||
with:
|
with:
|
||||||
context: ./
|
buildkit_version: ${{ env.BUILDKIT_VERSION }}
|
||||||
file: ./Dockerfile
|
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
push: false
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
||||||
- run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
- run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
|||||||
@@ -1,38 +1,58 @@
|
|||||||
name: Python CI
|
name: Python CI
|
||||||
on: [ push ]
|
|
||||||
|
concurrency:
|
||||||
|
group: python-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on: [push, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ruff:
|
ruff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- name: Checkout repository
|
||||||
- uses: astral-sh/ruff-action@v3
|
uses: actions/checkout@v5
|
||||||
|
- name: Run Ruff check
|
||||||
|
uses: https://github.com/astral-sh/ruff-action@v3
|
||||||
with:
|
with:
|
||||||
args: "check"
|
args: "check"
|
||||||
|
|
||||||
ruff-format-check:
|
ruff-format-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- name: Checkout repository
|
||||||
- uses: astral-sh/ruff-action@v3
|
uses: actions/checkout@v5
|
||||||
|
- name: Run Ruff format check
|
||||||
|
uses: https://github.com/astral-sh/ruff-action@v3
|
||||||
with:
|
with:
|
||||||
args: "format --check --diff"
|
args: "format --check --diff"
|
||||||
|
|
||||||
ty:
|
ty:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: python3 -m pip install uv --break-system-packages
|
- name: Install UV
|
||||||
- uses: actions/checkout@v5
|
run: python3 -m pip install uv --break-system-packages
|
||||||
- run: python3 -m uv sync
|
- name: Checkout repository
|
||||||
- run: python3 -m uv run ty check --output-format github
|
uses: actions/checkout@v5
|
||||||
|
- name: Sync Python dependencies
|
||||||
|
run: python3 -m uv sync
|
||||||
|
- name: Run ty check
|
||||||
|
run: python3 -m uv run ty check --output-format github
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: python3 -m pip install uv --break-system-packages
|
- name: Install UV
|
||||||
- uses: actions/checkout@v5
|
run: python3 -m pip install uv --break-system-packages
|
||||||
- run: python3 -m uv sync
|
- name: Checkout repository
|
||||||
- run: python3 -m uv run coverage run -m unittest -v
|
uses: actions/checkout@v5
|
||||||
- run: python3 -m uv run coverage xml
|
- name: Sync Python dependencies
|
||||||
- uses: irongut/CodeCoverageSummary@v1.3.0
|
run: python3 -m uv sync
|
||||||
|
- name: Run tests with coverage
|
||||||
|
run: python3 -m uv run coverage run -m unittest -v
|
||||||
|
- name: Generate coverage XML report
|
||||||
|
run: python3 -m uv run coverage xml
|
||||||
|
- name: Create coverage summary
|
||||||
|
uses: https://github.com/irongut/CodeCoverageSummary@v1.3.0
|
||||||
with:
|
with:
|
||||||
filename: coverage.xml
|
filename: coverage.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user