Skip to content

test_daemon: Fix persistent database usage #73

test_daemon: Fix persistent database usage

test_daemon: Fix persistent database usage #73

Workflow file for this run

# Registry push (image_build) uses these repository secrets when not using
# ghcr.io with GITHUB_TOKEN:
# REGISTRY - registry host (e.g. quay.io, registry.example.com)
# REGISTRY_USER - login username
# REGISTRY_PASSWORD - login password or token
# Optional:
# REGISTRY_IMAGE - image repository path without tag (default: ghcr.io/<owner>/<repo>)
name: CI
on:
push:
branches: ["**"]
tags: ["*"]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PROJECT_NAME: elnbuildsync
jobs:
ruff-check:
name: Ruff Check
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/ruff:alpine
steps:
- uses: actions/checkout@v6
- name: Ruff version
run: ruff --version
- name: Ruff check
run: |
ruff check --output-format=github --output-file=code-quality-report.json
- name: Upload code quality report
if: always()
uses: actions/upload-artifact@v7
with:
name: ruff-code-quality
path: code-quality-report.json
ruff-format:
name: Ruff Format
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/ruff:alpine
steps:
- uses: actions/checkout@v6
- name: Ruff version
run: ruff --version
- name: Ruff format
run: ruff format --diff
flake8:
runs-on: ubuntu-latest
container: python:3.14-alpine
steps:
- uses: actions/checkout@v6
- name: Install flake8
run: pip install flake8-gl-codeclimate
- name: Flake8 version
run: flake8 --version
- name: Run flake8
run: |
flake8 --format gl-codeclimate --extend-ignore=E501 \
--output-file gl-code-quality-report.json \
.
- name: Upload code quality report
if: always()
uses: actions/upload-artifact@v7
with:
name: flake8-code-quality
path: gl-code-quality-report.json
project_version:
runs-on: ubuntu-latest
container: python:3.14-alpine
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
- id: version
name: Read project version
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
echo "Version: ${VERSION}"
image_build:
needs: project_version
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
VERSION: ${{ needs.project_version.outputs.version }}
IMAGE_TAG: ${{ needs.project_version.outputs.version }}-${{ github.run_number }}
REGISTRY: ${{ secrets.REGISTRY || 'ghcr.io' }}
REGISTRY_IMAGE: ${{ secrets.REGISTRY_IMAGE || format('ghcr.io/{0}', github.repository) }}
steps:
- uses: actions/checkout@v6
- name: Log in to container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER || github.actor }}
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push image
uses: docker/build-push-action@v7
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
file: Dockerfile
tags: ${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}