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-03-01 13:06:16 -06:00
|
|
|
- uses: actions/checkout@v3
|
2021-04-07 03:57:14 -05:00
|
|
|
with:
|
|
|
|
# Full git history is needed to get a proper list of changed files within `super-linter`
|
|
|
|
fetch-depth: 0
|
2022-02-28 07:52:44 -06:00
|
|
|
- uses: actions/setup-python@v3
|
2021-02-08 04:59:57 -06:00
|
|
|
- name: Lint Code Base
|
2021-05-25 15:35:56 -05:00
|
|
|
uses: github/super-linter@v4
|
2021-02-08 04:59:57 -06:00
|
|
|
env:
|
|
|
|
DEFAULT_BRANCH: develop
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SUPPRESS_POSSUM: true
|
|
|
|
LINTER_RULES_PATH: /
|
|
|
|
VALIDATE_ALL_CODEBASE: false
|
|
|
|
VALIDATE_DOCKERFILE: false
|
2021-02-10 03:48:45 -06:00
|
|
|
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
|
2021-02-08 04:59:57 -06:00
|
|
|
|
|
|
|
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
|
2019-12-23 10:53:19 -06:00
|
|
|
build:
|
2021-01-20 02:57:30 -06:00
|
|
|
continue-on-error: ${{ matrix.docker_from == 'alpine:edge' }}
|
2019-12-23 10:53:19 -06:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
2021-04-24 03:58:15 -05:00
|
|
|
- ./build.sh feature
|
2020-04-08 14:38:50 -05:00
|
|
|
- ./build.sh develop
|
2019-12-23 10:53:19 -06:00
|
|
|
docker_from:
|
2020-08-24 07:39:50 -05:00
|
|
|
- '' # use the default of the build script
|
2019-12-23 10:53:19 -06:00
|
|
|
fail-fast: false
|
|
|
|
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:
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: git-checkout
|
|
|
|
name: Checkout
|
2022-03-01 13:06:16 -06:00
|
|
|
uses: actions/checkout@v3
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: docker-build
|
|
|
|
name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
|
2019-12-23 10:53:19 -06:00
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
env:
|
|
|
|
DOCKER_FROM: ${{ matrix.docker_from }}
|
|
|
|
GH_ACTION: enable
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: docker-test
|
|
|
|
name: Test the image
|
2019-12-23 10:53:19 -06:00
|
|
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
2020-01-17 11:10:36 -06:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|