Skip to content

Update workflow.yml

Update workflow.yml #4

Workflow file for this run

name: workflow
on:
push:
branches:
- **

Check failure on line 6 in .github/workflows/workflow.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/workflow.yml

Invalid workflow file

You have an error in your yaml syntax on line 6
paths:
- "**.py"
- "**.ini"
- "**.toml"
- "**.lock"
pull_request:
branches:
- main
paths:
- "**.py"
- "**.ini"
- "**.toml"
- "**.lock"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --group test
- name: Run tests with coverage
run: uv run pytest --cov=app --cov-report=term-missing --cov-fail-under=80
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max