Make RacksDB dependency optional #82
Workflow file for this run
This file contains hidden or 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: Backend Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'slurmweb/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| - 'setup.py' | |
| - '.github/workflows/python-ci.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'slurmweb/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| - 'setup.py' | |
| - '.github/workflows/python-ci.yml' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| jobs: | |
| python_tests: | |
| name: Python unit tests | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-latest"] | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install tests dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential python3-dev libldap2-dev libsasl2-dev libcairo2-dev libgirepository-1.0-dev libgirepository-2.0-dev libpango1.0-dev | |
| python -m pip install --upgrade pip | |
| - name: Install application with its dependencies | |
| run: | | |
| pip install . .[agent] .[gateway] .[tests] | |
| - name: Run tests | |
| run: pytest | |
| os_rpm_tests: | |
| name: OS integration tests (rpm) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| envs: | |
| - container: rockylinux/rockylinux:8 | |
| epel: 8 | |
| repo: powertools | |
| rackslab-repo: el8 | |
| racksdb-pkg: python3-racksdb-web | |
| - container: rockylinux/rockylinux:9 | |
| epel: 9 | |
| rackslab-repo: el9 | |
| repo: crb | |
| racksdb-pkg: python3-racksdb+web | |
| - container: fedora:42 | |
| rackslab-repo: fc42 | |
| racksdb-pkg: python3-racksdb+web | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.envs.container }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable EPEL repository (Rocky Linux) | |
| if: ${{ startsWith(matrix.envs.container, 'rockylinux') }} | |
| run: | | |
| dnf -y install 'dnf-command(config-manager)' | |
| dnf config-manager --set-enabled ${{ matrix.envs.repo }} | |
| dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${{ matrix.envs.epel }}.noarch.rpm | |
| - name: Add Rackslab repository | |
| run: | | |
| curl --silent https://pkgs.rackslab.io/keyring.asc --output /etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab | |
| cat <<EOF > /etc/yum.repos.d/rackslab.repo | |
| [rackslab] | |
| name=Rackslab | |
| baseurl=https://pkgs.rackslab.io/rpm/${{ matrix.envs.rackslab-repo }}/main/x86_64/ | |
| gpgcheck=1 | |
| gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab | |
| EOF | |
| - name: Install tests dependencies | |
| run: | | |
| dnf -y install \ | |
| python3-aiohttp \ | |
| python3-clustershell \ | |
| python3-flask \ | |
| python3-importlib-metadata \ | |
| python3-markdown \ | |
| python3-parameterized \ | |
| python3-pip \ | |
| python3-prometheus_client \ | |
| python3-pytest \ | |
| python3-PyYAML \ | |
| ${{ matrix.envs.racksdb-pkg }} \ | |
| python3-redis \ | |
| python3-requests \ | |
| python3-rfl-authentication \ | |
| python3-rfl-build \ | |
| python3-rfl-core \ | |
| python3-rfl-log \ | |
| python3-rfl-settings \ | |
| python3-rfl-web | |
| # Unfortunately, pip and setuptools in RHEL8 do not fully support | |
| # PEP517 pyproject.toml. As a workaround for this version, the setup.py | |
| # script provided by RFL.build package is copied and executed. | |
| # | |
| # Latest version of setuptools build wheels following PEP-491 naming | |
| # conventions (eg. RFL.core becomes rfl-core) published with this name on | |
| # PyPI but old versions of setuptools do not support this naming | |
| # equivalence. For this reason, RFL dependencies are renamed with sed in | |
| # pyproject.toml so old versions of setuptools can find the wheels on | |
| # PyPI. | |
| - name: Install RFL.build setup wrapper (Rocky Linux 8) | |
| if: ${{ matrix.envs.container == 'rockylinux/rockylinux:8' }} | |
| run: | | |
| cp -v /usr/lib/python3.6/site-packages/rfl/build/scripts/setup setup.py | |
| sed -i 's/RFL\./rfl-/' pyproject.toml | |
| - name: Install application | |
| run: pip3 install -e . | |
| - name: Run tests | |
| run: pytest-3 | |
| os_deb_tests: | |
| name: OS integration tests (deb) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| envs: | |
| - container: debian:oldstable | |
| rackslab-repo: bookworm | |
| - container: debian:stable | |
| rackslab-repo: trixie | |
| - container: debian:testing | |
| rackslab-repo: forky | |
| - container: debian:unstable | |
| rackslab-repo: sid | |
| - container: ubuntu:noble | |
| rackslab-repo: ubuntu24.04 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.envs.container }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Add Rackslab repository | |
| run: | | |
| apt update | |
| apt install -y ca-certificates curl gpg | |
| curl -sS https://pkgs.rackslab.io/keyring.asc | gpg --dearmor | tee /usr/share/keyrings/rackslab.gpg > /dev/null | |
| cat <<EOF > /etc/apt/sources.list.d/rackslab.sources | |
| Types: deb | |
| URIs: https://pkgs.rackslab.io/deb | |
| Suites: ${{ matrix.envs.rackslab-repo }} | |
| Components: main | |
| Architectures: amd64 | |
| Signed-By: /usr/share/keyrings/rackslab.gpg | |
| EOF | |
| - name: Install tests dependencies | |
| run: | | |
| apt update | |
| apt install -y \ | |
| python3-aiohttp \ | |
| python3-clustershell \ | |
| python3-flask \ | |
| python3-markdown \ | |
| python3-parameterized \ | |
| python3-pip \ | |
| python3-prometheus-client \ | |
| python3-pytest \ | |
| python3-yaml \ | |
| python3-racksdb-web \ | |
| python3-redis \ | |
| python3-requests \ | |
| python3-rfl-authentication \ | |
| python3-rfl-build \ | |
| python3-rfl-core \ | |
| python3-rfl-log \ | |
| python3-rfl-settings \ | |
| python3-rfl-web \ | |
| python3-venv | |
| - name: Install application | |
| run: | | |
| python3 -m venv --system-site-packages ~/venv | |
| ~/venv/bin/pip install -e . | |
| - name: Run tests | |
| run: pytest |