Add initial pytest testing. #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: "Run Unit Tests" | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| 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/${{ matrix.infrahub-version }} | sudo docker compose -f up -d | |
| - name: "Wait for Infrahub to become accessible" | |
| uses: iFaxity/[email protected] | |
| with: | |
| resource: http://localhost:8000 | |
| - name: "Run Pytest" | |
| run: | | |
| pytest |