Skip to content

Add the web service implementation #56

Add the web service implementation

Add the web service implementation #56

Workflow file for this run

name: Run tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.12" ]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Podman and Buildah
run: |
sudo apt-get update
sudo apt-get install -y podman buildah
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
- name: Install pytest
run: |
python -m pip install pytest
python -m pip install -r src/requirements.txt
- name: Build the web image
run: |
buildah bud -t tmt-web:latest --build-arg PYTHON_VERSION=${{ matrix.python-version }} .
- name: Create and start Podman pod
run: |
podman play kube tmt-web-pod.yaml
- name: Wait for services to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:8000/health; then
break
fi
sleep 4
done
- name: Run tests
run: |
python -m pytest
- name: Cleanup
if: always()
run: |
podman pod stop tmt-web-pod
podman pod rm tmt-web-pod