92 строки
2.7 KiB
YAML
92 строки
2.7 KiB
YAML
---
|
|
###########################
|
|
###########################
|
|
## Linter GitHub Actions ##
|
|
###########################
|
|
###########################
|
|
name: Lint
|
|
|
|
#
|
|
# Documentation:
|
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
#
|
|
|
|
#############################
|
|
# Start the job on all push #
|
|
#############################
|
|
on: [ push, pull_request, workflow_dispatch ]
|
|
|
|
###############
|
|
# Set the Job #
|
|
###############
|
|
jobs:
|
|
# Name the Job
|
|
lint_code_base:
|
|
# Set the agent to run on
|
|
runs-on: ubuntu-latest
|
|
|
|
##################
|
|
# Load all steps #
|
|
##################
|
|
steps:
|
|
##########################
|
|
# Checkout the code base #
|
|
##########################
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Lint Code Base
|
|
uses: github/super-linter@v4.8.4
|
|
env:
|
|
VALIDATE_PYTHON_BLACK: true
|
|
VALIDATE_PYTHON_FLAKE8: true
|
|
VALIDATE_PYTHON_PYLINT: true
|
|
PYTHON_BLACK_CONFIG_FILE: black.toml
|
|
PYTHON_FLAKE8_CONFIG_FILE: tox.ini
|
|
PYTHON_PYLINT_CONFIG_FILE: .pylintrc
|
|
FILTER_REGEX_INCLUDE: .*scenarios/.*
|
|
FILTER_REGEX_EXCLUDE: .*tests/.*|.*scenarios/action_recognition/.*|.*scenarios/classification/tools/sweep.py*
|
|
DEFAULT_BRANCH: main
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# - name: Bandit Security Linter
|
|
# uses: jpetrucciani/bandit-check@master
|
|
# with:
|
|
# bandit_flags: '-c .bandit'
|
|
|
|
# test_code_base:
|
|
# # Set the agent to run on
|
|
# runs-on: ubuntu-latest
|
|
|
|
# ##################
|
|
# # Unit and integration test steps #
|
|
# ##################
|
|
# steps:
|
|
# - name: Checkout Code
|
|
# uses: actions/checkout@v3
|
|
# - name: Add Conda to PATH
|
|
# run: |
|
|
# echo "##vso[task.prependpath]/data/anaconda/bin"
|
|
|
|
# - name: 'Remove conda env in case it was not created correctly'
|
|
# run: |
|
|
# rm -rf /data/anaconda/envs/cv
|
|
|
|
# - name: 'Create and activate conda environment'
|
|
# run: |
|
|
# conda env create -f environment.yml
|
|
# source activate cv
|
|
# conda env list
|
|
|
|
# - name: 'Run unit and (only on Linux GPU) integration tests'
|
|
# run: |
|
|
# source activate cv
|
|
# # python -m ipykernel install --user --name cv --display-name "cv"
|
|
# pytest --durations 100 tests --junitxml=junit/test-unitttest.xml -m "not azuremlnotebooks and not linuxgpu"
|
|
|
|
# - name: 'Cleanup Task'
|
|
# run: |
|
|
# echo Remove Conda Environment
|
|
# conda remove -n cv --all -q --force -y
|
|
# conda env list
|
|
# echo Done Cleanup |