2022-06-15 01:22:11 -05:00
|
|
|
---
|
2020-01-23 02:35:30 -06:00
|
|
|
name: push
|
|
|
|
|
2019-12-23 10:53:19 -06:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- release
|
2020-01-30 08:48:01 -06:00
|
|
|
pull_request:
|
|
|
|
branches-ignore:
|
|
|
|
- release
|
2019-12-23 10:53:19 -06:00
|
|
|
|
|
|
|
jobs:
|
2021-02-08 04:59:57 -06:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Checks syntax of our code
|
|
|
|
steps:
|
2022-06-15 01:22:11 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
# Full git history is needed to get a proper
|
|
|
|
# list of changed files within `super-linter`
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Lint Code Base
|
2023-04-14 14:16:09 -05:00
|
|
|
uses: github/super-linter@v5
|
2022-06-15 01:22:11 -05:00
|
|
|
env:
|
|
|
|
DEFAULT_BRANCH: develop
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SUPPRESS_POSSUM: true
|
|
|
|
LINTER_RULES_PATH: /
|
|
|
|
VALIDATE_ALL_CODEBASE: false
|
|
|
|
VALIDATE_DOCKERFILE: false
|
2022-11-30 03:03:27 -06:00
|
|
|
VALIDATE_GITLEAKS: false
|
2022-06-15 01:22:11 -05:00
|
|
|
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
|
|
|
|
EDITORCONFIG_FILE_NAME: .ecrc
|
|
|
|
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
|
|
|
|
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
|
|
|
|
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
|
|
|
|
PYTHON_FLAKE8_CONFIG_FILE: .flake8
|
|
|
|
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
|
|
|
|
YAML_CONFIG_FILE: .yamllint.yaml
|
2019-12-23 10:53:19 -06:00
|
|
|
build:
|
2022-06-15 01:22:11 -05:00
|
|
|
continue-on-error: ${{ matrix.build_cmd != './build-latest.sh' }}
|
2019-12-23 10:53:19 -06:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
2022-06-15 01:22:11 -05:00
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
|
|
|
- ./build.sh feature
|
|
|
|
- ./build.sh develop
|
|
|
|
platform:
|
|
|
|
- linux/amd64
|
|
|
|
- linux/arm64
|
2019-12-23 10:53:19 -06:00
|
|
|
fail-fast: false
|
2022-06-15 01:22:11 -05:00
|
|
|
env:
|
|
|
|
GH_ACTION: enable
|
2023-01-28 05:00:40 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-15 01:22:11 -05:00
|
|
|
IMAGE_NAMES: docker.io/netboxcommunity/netbox
|
2019-12-23 10:53:19 -06:00
|
|
|
runs-on: ubuntu-latest
|
2021-02-04 14:48:08 -06:00
|
|
|
name: Builds new NetBox Docker Images
|
2019-12-23 10:53:19 -06:00
|
|
|
steps:
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: git-checkout
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- id: qemu-setup
|
|
|
|
name: Set up QEMU
|
2022-07-15 13:36:01 -05:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: buildx-setup
|
|
|
|
name: Set up Docker Buildx
|
2022-07-16 03:23:01 -05:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: docker-build
|
|
|
|
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
|
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
env:
|
|
|
|
BUILDX_PLATFORM: ${{ matrix.platform }}
|
|
|
|
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
|
2023-04-06 05:05:02 -05:00
|
|
|
- id: arm-time-limit
|
|
|
|
name: Set Netbox container start_period higher on ARM64
|
|
|
|
if: matrix.platform == 'linux/arm64'
|
|
|
|
run: |
|
|
|
|
echo "NETBOX_START_PERIOD=240s" >>"${GITHUB_ENV}"
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: docker-test
|
|
|
|
name: Test the image
|
|
|
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|