Skip to content

Onboard Konflux image builds #2568

Onboard Konflux image builds

Onboard Konflux image builds #2568

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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Install uv
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Install uv
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- 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
functional-tests:
name: Functional Tests
needs: hadolint
runs-on: ubuntu-latest
env:
IMAGE_NAME: waiverdb
REGISTRY: quay.io/factory2
GH_REGISTRY: ghcr.io/${{ github.actor }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Install uv
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # 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: Build Image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
image: ${{ env.IMAGE_NAME }}
tags: >-
${{ github.ref == 'refs/heads/master' && 'latest' || '' }}
${{ github.sha }}
containerfiles: Dockerfile
build-args: |
SHORT_COMMIT=${{ github.sha }}
COMMIT_TIMESTAMP=1
EXPIRES_AFTER=${{ github.ref == 'refs/heads/master' && 'never' || '30d' }}
- 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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
if: failure()
with:
name: pytest-logs
path: /tmp/pytest-of-runner/
retention-days: 14