Skip to content

Lock file maintenance #2577

Lock file maintenance

Lock file maintenance #2577

Workflow file for this run

---
name: Gating
"on":
pull_request:
push:
workflow_dispatch:
inputs: {}
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
with:
python-version: "3.13"
enable-cache: true
- name: Install system dependencies
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: >-
sudo apt-get update
&& sudo apt-get install
libkrb5-dev
libldap2-dev
libsasl2-dev
- name: Test with tox
run: uvx --with tox-uv tox -e py3
- name: Collect coverage with Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
uvx --with coveralls coveralls --service=github
- name: Upload coverage to Coveralls
run: |
uvx --with coveralls coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linters:
name: Linters
strategy:
matrix:
tox_env:
- bandit
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
with:
python-version: "3.13"
enable-cache: true
- name: Test '${{ matrix.tox_env }}' with tox
run: uvx --with tox-uv tox -e ${{ matrix.tox_env }}
hadolint:
name: Hadolint
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- Dockerfile
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: ${{ matrix.dockerfile }}
# Ignore list:
# * DL3041 - Specify version with dnf install -y <package>-<version>
ignore: DL3041
failure-threshold: warning
image-build:
name: Container Image Build
needs: hadolint
runs-on: ubuntu-latest
env:
IMAGE_NAME: waiverdb
REGISTRY: quay.io/factory2
GH_REGISTRY: ghcr.io/${{ github.actor }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
with:
python-version: "3.13"
enable-cache: true
- name: Install system dependencies
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: >-
sudo apt-get update
&& sudo apt-get install
libkrb5-dev
libldap2-dev
libsasl2-dev
- name: Update the Application Version
run: |
NEW_VERSION="$(./get-version.sh)"
uv version "$NEW_VERSION"
- name: Get image tag from git branch
run: |
export TAG=$(sed 's/[^0-9a-zA-Z_.-]/__/g' <<< "$GITHUB_REF_NAME") &&
echo "VERSION_TAG=$TAG" >> $GITHUB_ENV
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
image: ${{ env.IMAGE_NAME }}
tags: >-
${{ env.VERSION_TAG }}
${{ github.ref == 'refs/heads/master' && 'latest' || '' }}
${{ github.sha }}
containerfiles: Dockerfile
build-args: |
GITHUB_SHA=${{ github.sha }}
EXPIRES_AFTER=${{ github.ref == 'refs/heads/master' && 'never' || '30d' }}
- name: Log in to the image registry
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1
with:
registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }}
username: ${{ secrets.REGISTRY_USER || github.actor }}
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
- name: Push Image
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }}
- name: Install Chromium for functional tests
run: |
sudo apt-get -y update &&
sudo apt-get -y install chromium-browser
- name: Test Image
run: |
.github/run-functional-tests.sh "${{ steps.build-image.outputs.image }}:${{ github.sha }}"
- name: Upload pytest logs
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: failure()
with:
name: pytest-logs
path: /tmp/pytest-of-runner/
retention-days: 14