Repository navigation
chore(release): release 0.6.0 #46
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: Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| netbox_ref: | |
| description: 'NetBox ref to check out (branch, tag or commit)' | |
| required: false | |
| default: 'v4.7.0' | |
| type: string | |
| concurrency: | |
| group: tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: NetBox ${{ matrix.netbox }} on Python ${{ matrix.python }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # This branch is the NetBox 4.7 line and is tested against nothing else. 4.7 drops | |
| # the django-mptt columns, so netbox-branching 1.1.x cannot run on it and 1.2 cannot | |
| # run on 4.6; there is no version of NetBox both lines share. The 0.4.x branch keeps | |
| # the 4.6 job. | |
| include: | |
| - netbox: 'v4.7.0' | |
| python: '3.12' | |
| - netbox: 'v4.7.0' | |
| python: '3.13' | |
| - netbox: 'v4.7.0' | |
| python: '3.14' | |
| services: | |
| redis: | |
| # NetBox 4.7 requires Redis 6.0 or later. | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| postgres: | |
| # NetBox needs the ICU collation provider, which the official image provides. 17 is | |
| # above the 15 floor NetBox 4.7 sets, and ships the ltree extension 4.7 installs | |
| # itself; the GRANT below is what lets it, since installing an extension needs CREATE | |
| # on the database. | |
| image: postgres:17 | |
| env: | |
| POSTGRES_USER: netbox | |
| POSTGRES_PASSWORD: netbox | |
| POSTGRES_DB: netbox | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Check out the plugin | |
| uses: actions/checkout@v7 | |
| with: | |
| path: netbox-change-control | |
| - name: Check out NetBox ${{ matrix.netbox }} | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: netbox-community/netbox | |
| ref: ${{ inputs.netbox_ref || matrix.netbox }} | |
| path: netbox | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install NetBox requirements | |
| working-directory: netbox | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install netbox-branching and the plugin | |
| run: | | |
| # 1.2.2 advances the conflict baseline on sync, which the conflict check relies on. | |
| pip install 'netboxlabs-netbox-branching>=1.2.2,<1.3' | |
| # Editable, so the tests run from the checkout. Several of them read the pages in | |
| # docs/ and compare them against the code, and a plain install copies the package | |
| # into site-packages without the documentation beside it, where those tests can | |
| # only fail. The release workflow builds and checks the real distribution. | |
| pip install -e ./netbox-change-control | |
| - name: Configure NetBox | |
| run: | | |
| ln -s "$GITHUB_WORKSPACE/netbox-change-control/testing/configuration.py" \ | |
| "$GITHUB_WORKSPACE/netbox/netbox/netbox/configuration.py" | |
| - name: Grant the database user permission to create schemas | |
| env: | |
| PGPASSWORD: netbox | |
| run: | | |
| # netbox-branching provisions one PostgreSQL schema per branch. | |
| # This also covers the ltree extension NetBox 4.7 installs on first migrate. | |
| psql -h localhost -U netbox -d netbox -c 'GRANT CREATE ON DATABASE netbox TO netbox;' | |
| - name: Check for missing migrations | |
| working-directory: netbox | |
| run: python netbox/manage.py makemigrations netbox_change_control --check --dry-run | |
| - name: Run the test suite | |
| working-directory: netbox | |
| run: python netbox/manage.py test netbox_change_control --keepdb -v 2 |