Files
mtusi2026lab7/.github/workflows/contracts.yml
T
kittsune 2cc9497f98
Lab 7 checks / contracts (pull_request) Canceled after 0s
Lab 7 checks / application (pull_request) Canceled after 0s
Fix MinIO image pull in CI
2026-11-11 15:32:54 +03:00

62 lines
2.3 KiB
YAML

name: Lab 7 checks
on: [push, pull_request]
permissions:
contents: read
jobs:
contracts:
runs-on: ubuntu-latest
steps:
- name: Download source at workflow commit
env:
CI_REPOSITORY: ${{ github.repository }}
CI_REVISION: ${{ github.sha }}
run: |
archive="$(mktemp)"
trap 'rm -f -- "$archive"' EXIT
curl --fail --silent --show-error --location --retry 2 \
--connect-timeout 10 --max-time 90 \
"https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \
--output "$archive"
tar --extract --gzip --file="$archive" --strip-components=1
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install -r requirements-dev.txt
- run: make check validate PYTHON=python
application:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Download source at workflow commit
env:
CI_REPOSITORY: ${{ github.repository }}
CI_REVISION: ${{ github.sha }}
run: |
archive="$(mktemp)"
trap 'rm -f -- "$archive"' EXIT
curl --fail --silent --show-error --location --retry 2 \
--connect-timeout 10 --max-time 90 \
"https://gitea.privcloud.tech/$CI_REPOSITORY/archive/$CI_REVISION.tar.gz" \
--output "$archive"
tar --extract --gzip --file="$archive" --strip-components=1
- name: Check Docker runtime
env:
CI_RUN_ID: ${{ github.run_id }}
run: |
docker info --format '{{.ServerVersion}}'
docker compose version
attempt="$(python3 -c 'import secrets; print(secrets.token_hex(4))')"
printf 'COMPOSE_PROJECT_NAME=lab7-ci-%s-%s\n' "$CI_RUN_ID" "$attempt" >> "$GITHUB_ENV"
- name: Build, bootstrap and wait for both API replicas
run: scripts/start.sh
- name: Run public HTTPS smoke
run: make test CA_FILE="$PWD/secrets/authority/ca.crt"
- name: Show service status after failure
if: failure()
run: |
if test -n "${COMPOSE_PROJECT_NAME:-}"; then docker compose ps --all; fi
- name: Stop CI stack
if: always()
run: |
if test -n "${COMPOSE_PROJECT_NAME:-}"; then docker compose down; fi