Skip to content

feat(ci): automatically test podman-compose.yml #3

feat(ci): automatically test podman-compose.yml

feat(ci): automatically test podman-compose.yml #3

Workflow file for this run

name: Test podman-compose.yml
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
TERM: xterm-color
PY_COLORS: 1
LOG_LEVEL: DEBUG
jobs:
build:
runs-on: ubuntu-latest
name: podman-compose integration test
steps:
- uses: actions/checkout@v4
- name: Install ImageBuilder prereqs
run: sudo apt-get install -y podman-compose jq
- name: Build the containers
run: |
podman-compose build
- name: Start the containers
run: |
podman-compose up -d
- name: Let the containers start
run: sleep 10
- name: Test startup
run: |
queue_length="$(curl -s http://localhost:8000/api/v1/stats | jq .queue_length)"
[ "$queue_length" -eq 0 ] || exit 1
- name: Test build
run: |
curl 'http://localhost:8000/api/v1/build' \
--request 'POST' \
--header 'Content-Type: application/json' \
--data @ tests/ci/openwrt-one-24.10.0.json > build_response.json
status_code=$(jq -r '.status' build_response.json)
[ "$status_code" -eq 202 ] || exit 1
sleep 30
curl 'http://localhost:8000/api/v1/build' \
--request 'POST' \
--header 'Content-Type: application/json' \
--data @ tests/ci/openwrt-one-24.10.0.json > build_response.json
status_code=$(jq -r '.status' build_response.json)
[ "$status_code" -eq 200 ] || exit 1