CI #447
This file contains 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: CI | |
"on": | |
push: | |
branches: | |
- "*" | |
pull_request: | |
schedule: | |
- cron: 0 0 * * 0 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: chartboost/ruff-action@v1 | |
- uses: chartboost/ruff-action@v1 | |
with: | |
args: format --check | |
test: | |
strategy: | |
matrix: | |
include: | |
- netbox: v4.0 | |
- netbox: v4.1 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Setup Python 3.12 | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: poetry | |
- run: poetry install | |
if: steps.setup-python.outputs.cache-hit != 'true' | |
- name: Ensure playwright browsers are installed | |
run: poetry run playwright install --with-deps | |
- name: Run poetry build | |
run: poetry build | |
- name: Run test_setup.sh | |
run: ./tests/test_setup.sh | |
env: | |
NETBOX_CONTAINER_TAG: ${{ matrix.netbox }} | |
- name: Run pytest | |
run: | | |
poetry run pytest --tracing=retain-on-failure -v | |
- name: Upload Playwright traces | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-traces | |
path: test-results/ | |
- name: Show Docker logs | |
if: ${{ always() }} | |
run: docker compose logs | |
working-directory: ./tests/docker/ |