mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add UI checks to pre-commit and CI
This commit is contained in:
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -6,6 +6,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.7, 3.8, 3.9]
|
python-version: [3.7, 3.8, 3.9]
|
||||||
|
node-version: [14.x, 15.x]
|
||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
@ -33,12 +34,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install dependencies & set up configuration
|
- name: Install dependencies & set up configuration
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pycodestyle coverage
|
pip install pycodestyle coverage
|
||||||
ln -s configuration.testing.py netbox/netbox/configuration.py
|
ln -s configuration.testing.py netbox/netbox/configuration.py
|
||||||
|
yarn --cwd netbox/project-static
|
||||||
|
|
||||||
- name: Build documentation
|
- name: Build documentation
|
||||||
run: mkdocs build
|
run: mkdocs build
|
||||||
@ -49,6 +56,9 @@ jobs:
|
|||||||
- name: Check PEP8 compliance
|
- name: Check PEP8 compliance
|
||||||
run: pycodestyle --ignore=W504,E501 netbox/
|
run: pycodestyle --ignore=W504,E501 netbox/
|
||||||
|
|
||||||
|
- name: Check UI ESLint, TypeScript, and Prettier Compliance
|
||||||
|
run: yarn --cwd netbox/project-static validate
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: coverage run --source="netbox/" netbox/manage.py test netbox/
|
run: coverage run --source="netbox/" netbox/manage.py test netbox/
|
||||||
|
|
||||||
|
@ -34,6 +34,12 @@ if [ $? != 0 ]; then
|
|||||||
EXIT=1
|
EXIT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Checking UI ESLint, TypeScript, and Prettier compliance..."
|
||||||
|
yarn --cwd "$PWD/netbox/project-static" validate
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
EXIT=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $EXIT != 0 ]; then
|
if [ $EXIT != 0 ]; then
|
||||||
printf "${RED}COMMIT FAILED${NOCOLOR}\n"
|
printf "${RED}COMMIT FAILED${NOCOLOR}\n"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user