Update all dependencies #1469
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Gating | |
"on": | |
pull_request: | |
push: | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 | |
with: | |
python-version: "3.12" | |
- name: Install system dependencies | |
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 | |
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: Install dependencies | |
run: python -m pip install tox | |
- name: Test with tox | |
run: python -m tox -e py3 | |
- name: Run coveralls-python | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }} | |
COVERALLS_PARALLEL: true | |
run: | | |
pip3 install --upgrade pip | |
pip3 install --upgrade setuptools | |
pip3 install --upgrade coveralls==3.2.0 | |
coveralls --service=github | |
coveralls-finish: | |
name: Finish coveralls-python | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Finished | |
run: | | |
pip3 install --upgrade pip | |
pip3 install --upgrade setuptools | |
pip3 install --upgrade 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Test '${{ matrix.tox_env }}' with tox | |
run: tox -e ${{ matrix.tox_env }} | |
hadolint: | |
name: Hadolint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dockerfile: | |
- Dockerfile | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 | |
with: | |
python-version: "3.12" | |
- name: Install system dependencies | |
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 | |
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: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry podman-compose tox | |
- name: Update the Application Version | |
run: poetry version "$(./get-version.sh)" | |
- name: Get image tag from git branch | |
id: get-image-tag | |
run: | | |
export TAG=$(sed 's/[^0-9a-zA-Z_.-]/__/g' <<< "$GITHUB_REF_NAME") && | |
echo "::set-output name=tag::$TAG" | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: >- | |
${{ steps.get-image-tag.outputs.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 docker-compose | |
run: | | |
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && | |
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | sudo apt-key add - && | |
sudo apt-get -y update && | |
sudo apt-get -y install chromium-browser && | |
sudo apt-get -y -o Dpkg::Options::="--force-overwrite" install podman | |
- name: Test Image | |
run: | | |
.github/run-functional-tests.sh "${{ steps.build-image.outputs.image }}:${{ github.sha }}" | |
- name: Upload pytest logs | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
if: failure() | |
with: | |
name: pytest-logs | |
path: /tmp/pytest-of-runner/ | |
retention-days: 14 |