Skip to content

Add initial pytest testing. #10

Add initial pytest testing.

Add initial pytest testing. #10

Workflow file for this run

---
name: "Run Unit Tests"
on:
pull_request:
branches:
- main
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# Latest 1.0.x release, stable release, and latest release
infrahub-version: ["1.0", stable, latest]
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.12"
- name: "Setup environment"
run: |
pipx install poetry
- name: "Install dependencies"
run: |
poetry install --no-ansi --no-root
- name: "Launch Infrahub"
run: |
curl https://infrahub.opsmill.io | VERSION=${{ matrix.infrahub-version }} docker compose -f - up -d
- name: "Wait for Infrahub to become accessible"
run: |
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8000/)" != "200" ]]; do echo "waiting for Infrahub"; sleep 5; done' || false
- name: "Run Pytest"
run: |
poetry run pytest