Prepare for upgrade to NetBox v4.0.6 (#40) #114
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: Docker Image CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: docker compose build --no-cache | |
- name: Verify the Docker image | |
# smoke test by checking if the migrations for app netbox_slm can be displayed | |
run: docker compose run netbox sh -c "/opt/netbox/venv/bin/python manage.py showmigrations netbox_slm" | |
- name: Run Django tests with coverage for netbox_slm | |
run: | | |
chmod go+w ci/reports | |
docker compose run netbox sh -c " \ | |
/opt/netbox/venv/bin/coverage run --source='netbox_slm' manage.py test netbox_slm && \ | |
/opt/netbox/venv/bin/coverage report --fail-under=0 && \ | |
/opt/netbox/venv/bin/coverage xml -o /ci/reports/coverage.xml" | |
- name: Sonarcloud scan | |
if: env.SONAR_TOKEN != null | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |