Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/backend-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd backend
poetry install
- name: Run functional tests in pod
run: |
cd backend
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
fetch-depth: 10
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.9"
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
cd backend
poetry install

- name: Build Frontend Image
id: build-front
Expand All @@ -39,7 +44,9 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: Generate version file
run: ./backend/scripts/version.py
run: |
cd backend
poetry run scripts/version.py

- name: Build Backend Image
id: build-back
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/frontend-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ jobs:
run:
working-directory: ./frontend
steps:
- name: checkout project
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
cd ../backend
poetry install
- name: build tests image
run: podman build -t cypress -f e2e_frontend.containerfile .
- name: Make e2e script executable
Expand All @@ -35,4 +42,3 @@ jobs:
with:
name: cypress-coverage-report
path: frontend/coverage

2 changes: 1 addition & 1 deletion .github/workflows/poetry-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.9"
- uses: Gr1N/setup-poetry@v9
- name: verify poetry instalation
run: poetry --version
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release-build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ jobs:
fetch-depth: 10
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.9"
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
cd backend
poetry install

- name: Build Frontend Image
id: build-front
Expand All @@ -40,7 +45,9 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: Generate version file
run: ./backend/scripts/version.py
run: |
cd backend
poetry run scripts/version.py

- name: Build Backend Image
id: build-back
Expand Down
1 change: 0 additions & 1 deletion backend/VERSION

This file was deleted.

14 changes: 13 additions & 1 deletion backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "openshift_perfscale_api"
requires-python = ">=3.9,<3.10"
dynamic = ["dependencies"]
version = "0.1.1"
description = "Python transformer of OpenShift performance and scale test results"
version = "0.2.2"
description = "Aggregator for Performance & Scale CPT data"
authors = [{name = "mleader", email = "mleader@redhat.com"}]

[tool.poetry]
Expand Down Expand Up @@ -35,6 +35,7 @@ trio = "^0.28.0"
uvicorn = "^0.34.0"
uvloop = "^0.21.0"
vyper-config = "1.0.0"
tomlkit = "^0.13.3"

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
Expand Down
12 changes: 6 additions & 6 deletions backend/scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import sys
from typing import Optional

import tomlkit


def do(cmd: list[str]) -> list[str]:
result = subprocess.run(cmd, text=True, capture_output=True)
Expand All @@ -32,7 +34,9 @@ def getone(cmd: list[str], if_none: Optional[str] = None) -> str:
def main():
top = Path(getone(["git", "rev-parse", "--show-toplevel"]))
backend = top / "backend"
version = (backend / "VERSION").read_text().strip()
with (backend / "pyproject.toml").open() as tml:
config = tomlkit.load(tml)
version = config["project"]["version"]
sha = getone(["git", "rev-parse", "--short", "HEAD"])
branch = getone(["git", "branch", "--show-current"], if_none="CI")
display = f"v{version}-{sha}"
Expand All @@ -53,8 +57,4 @@ def main():


if __name__ == "__main__":
try:
sys.exit(main())
except Exception as exc:
print(f"Failed with {str(exc)!r}", file=sys.stderr)
sys.exit(1)
sys.exit(main())
2 changes: 1 addition & 1 deletion testing/pod_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ echo "Creating pod ${POD_NAME}"
podman pod create --name=${POD_NAME} ${PUBLISH}

echo "Creating version"
${BACKEND}/scripts/version.py
( cd ${BACKEND}; poetry run scripts/version.py )
podman build -f backend.containerfile --tag backend "${BACKEND}"
podman build -f frontend.containerfile --tag frontend "${FRONTEND}"
podman build -f ${TESTING}/functional.containerfile --tag functional "${BRANCH}"
Expand Down
Loading