Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PMazarovich committed Aug 7, 2023
2 parents 5d0cc15 + 1c0a49f commit 0c83a79
Show file tree
Hide file tree
Showing 65 changed files with 2,110 additions and 567 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,11 @@ jobs:
CHANGED_FILES="${{steps.files.outputs.all_changed_files}}"
if [[ ! -z $CHANGED_FILES ]]; then
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
python3 -m venv .env
. .env/bin/activate
pip install -U pip wheel setuptools
pip install bandit
mkdir -p bandit_report
pipx install bandit
echo "Bandit version: "$(bandit --version | head -1)
echo "The files will be checked: "$(echo $CHANGED_FILES)
bandit -a file --ini .bandit -f html -o ./bandit_report/bandit_checks.html $CHANGED_FILES
deactivate
bandit -a file --ini .bandit $CHANGED_FILES
else
echo "No files with the \"py\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: bandit_report
path: bandit_report
17 changes: 2 additions & 15 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,15 @@ jobs:
UPDATED_DIRS="${{steps.files.outputs.all_changed_files}}"
if [[ ! -z $UPDATED_DIRS ]]; then
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
python3 -m venv .env
. .env/bin/activate
pip install -U pip wheel setuptools
pip install $(egrep "black.*" ./cvat-cli/requirements/development.txt)
mkdir -p black_report
pipx install $(egrep "black.*" ./cvat-cli/requirements/development.txt)
echo "Black version: "$(black --version)
echo "The dirs will be checked: $UPDATED_DIRS"
EXIT_CODE=0
for DIR in $UPDATED_DIRS; do
black --check --diff $DIR >> ./black_report/black_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true
black --check --diff $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true
done
deactivate
exit $EXIT_CODE
else
echo "No files with the \"py\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: black_report
path: black_report
11 changes: 1 addition & 10 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ jobs:
run: |
yarn install --frozen-lockfile
(cd tests && yarn install --frozen-lockfile)
yarn add eslint-detailed-reporter -D -W
- name: Run checks
run: |
echo "ESLint version: "$(yarn run -s eslint --version)
mkdir -p eslint_report
yarn run eslint . -f node_modules/eslint-detailed-reporter/lib/detailed.js -o ./eslint_report/eslint_checks.html
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: eslint_report
path: eslint_report
yarn run eslint .
13 changes: 8 additions & 5 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,19 @@ jobs:
name: expected_schema
path: cvat/schema-expected.yml

- name: Running REST API and SDK tests
id: run_tests
- name: Generate SDK
run: |
pip3 install -r cvat-sdk/gen/requirements.txt
./cvat-sdk/gen/generate.sh
pip3 install -r ./tests/python/requirements.txt
pip3 install -e ./cvat-sdk
pip3 install -e ./cvat-cli
- name: Install SDK
run: |
pip3 install -r ./tests/python/requirements.txt \
-e './cvat-sdk[pytorch,ultralytics]' -e ./cvat-cli
- name: Running REST API and SDK tests
id: run_tests
run: |
pytest tests/python/
- name: Creating a log file from cvat containers
Expand Down
20 changes: 1 addition & 19 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,8 @@ jobs:
curl -sL -o $HADOLINT "https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VER/hadolint-Linux-x86_64" && chmod 700 $HADOLINT
echo "HadoLint version: "$($HADOLINT --version)
echo "The files will be checked: "$(echo $CHANGED_FILES)
mkdir -p hadolint_report
$HADOLINT --no-fail --format json $CHANGED_FILES > ./hadolint_report/hadolint_report.json
GET_VERIFICATION_LEVEL=$(cat ./hadolint_report/hadolint_report.json | jq -r '.[] | .level')
for LINE in $GET_VERIFICATION_LEVEL; do
if [[ $LINE =~ $VERIFICATION_LEVEL ]]; then
pip install json2html
python ./tests/json_to_html.py ./hadolint_report/hadolint_report.json
exit 1
else
exit 0
fi
done
$HADOLINT -t $VERIFICATION_LEVEL $CHANGED_FILES
else
echo "No files with the \"Dockerfile*\" name found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: hadolint_report
path: hadolint_report
17 changes: 2 additions & 15 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,15 @@ jobs:
UPDATED_DIRS="${{steps.files.outputs.all_changed_files}}"
if [[ ! -z $UPDATED_DIRS ]]; then
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
python3 -m venv .env
. .env/bin/activate
pip install -U pip wheel setuptools
pip install $(egrep "isort.*" ./cvat-cli/requirements/development.txt)
mkdir -p isort_report
pipx install $(egrep "isort.*" ./cvat-cli/requirements/development.txt)
echo "isort version: $(isort --version-number)"
echo "The dirs will be checked: $UPDATED_DIRS"
EXIT_CODE=0
for DIR in $UPDATED_DIRS; do
isort --check $DIR >> ./isort_report/isort_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true
isort --check $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true
done
deactivate
exit $EXIT_CODE
else
echo "No files with the \"py\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: isort_report
path: isort_report
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
- name: Install SDK
run: |
pip3 install -r ./tests/python/requirements.txt \
-e './cvat-sdk[pytorch]' -e ./cvat-cli
-e './cvat-sdk[pytorch,ultralytics]' -e ./cvat-cli
- name: Run REST API and SDK tests
id: run_tests
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,15 @@ jobs:
CHANGED_FILES="${{steps.files.outputs.all_changed_files}}"
if [[ ! -z $CHANGED_FILES ]]; then
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
python3 -m venv .env
. .env/bin/activate
pip install -U pip wheel setuptools
pip install pylint-json2html
pip install $(egrep "pylint.*==.*" ./cvat/requirements/development.txt)
pip install $(egrep "django==.*" ./cvat/requirements/base.txt)
mkdir -p pylint_report
pipx install $(egrep "^pylint==" ./cvat/requirements/development.txt)
pipx inject pylint \
$(egrep "^pylint-.+==" ./cvat/requirements/development.txt) \
$(egrep "^django==" ./cvat/requirements/base.txt)
echo "Pylint version: "$(pylint --version | head -1)
echo "The files will be checked: "$(echo $CHANGED_FILES)
pylint $CHANGED_FILES --output-format=json > ./pylint_report/pylint_checks.json || EXIT_CODE=$(echo $?) || true
pylint-json2html -o ./pylint_report/pylint_checks.html ./pylint_report/pylint_checks.json
deactivate
exit $EXIT_CODE
pylint $CHANGED_FILES
else
echo "No files with the \"py\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: pylint_report
path: pylint_report
16 changes: 1 addition & 15 deletions .github/workflows/remark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ jobs:
- name: Run checks
run: |
yarn install --frozen-lockfile
mkdir -p remark_report
echo "Remark version: "`npx remark --version`
npx remark --quiet --report json --no-stdout -i .remarkignore . 2> ./remark_report/remark_report.json
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'`
if [[ ! -z ${get_report} ]]; then
pip install json2html
python ./tests/json_to_html.py ./remark_report/remark_report.json
exit 1
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: remark_report
path: remark_report
npx remark --quiet --frail -i .remarkignore .
13 changes: 1 addition & 12 deletions .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,10 @@ jobs:
if [[ ! -z $CHANGED_FILES ]]; then
yarn install --frozen-lockfile
mkdir -p stylelint_report
echo "StyleLint version: "$(npx stylelint --version)
echo "The files will be checked: "$(echo $CHANGED_FILES)
npx stylelint --formatter json --output-file ./stylelint_report/stylelint_report.json $CHANGED_FILES || EXIT_CODE=$(echo $?) || true
pip install json2html
python ./tests/json_to_html.py ./stylelint_report/stylelint_report.json
exit $EXIT_CODE
npx stylelint $CHANGED_FILES
else
echo "No files with the \"css|scss\" extension found"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: stylelint_report
path: stylelint_report
Loading

0 comments on commit 0c83a79

Please sign in to comment.