fix: try to fix workflows #1771
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python build | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Consistent with base image in Dockerfile | |
# container: stepik/hyperstyle-base:py3.8.11-java11.0.11-node14.17.3-go1.18.5 | |
container: nastyabirillo/hyperstyle:1.4.3 | |
steps: | |
- name: Install git | |
run: | | |
apt-get update | |
apt-get -y install git | |
- name: Check env variables | |
run: | | |
echo $DETEKT_DIRECTORY && echo $DETEKT_VERSION | |
echo $CHECKSTYLE_DIRECTORY && echo $CHECKSTYLE_VERSION | |
echo $PMD_DIRECTORY && echo $PMD_VERSION | |
echo $GOLANG_LINT_DIRECTORY && echo $GOLANG_LINT_VERSION | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install the tool | |
run: | | |
pip install --no-cache-dir . | |
- name: Set up git rights | |
run: | | |
git config --global --add safe.directory '*' | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules,hyperstyle/src/python/review/inspectors/common/inspector/proto | |
# TODO: change max-complexity into 10 after refactoring | |
# TODO: remove R504, A003, E800, E402, WPS1, WPS2, WPS3, WPS4, WPS5, WPS6, H601 | |
flake8 . --count --max-complexity=11 --max-line-length=120 --max-doc-length=120 --ignore=R504,A003,E800,E402,W503,WPS,H601,N400,I100,I201,I202, --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules,hyperstyle/src/python/review/inspectors/common/inspector/proto | |
- name: Sort whitelists | |
run: | | |
for file in "whitelist.txt" "hyperstyle/src/python/review/inspectors/flake8/whitelist.txt" | |
do | |
LC_ALL=C sort $file -o $file | |
done | |
- name: Commit sorted whitelists | |
uses: EndBug/add-and-commit@v7.2.1 | |
with: | |
add: "['whitelist.txt', 'hyperstyle/src/python/review/inspectors/flake8/whitelist.txt']" | |
message: 'Sort whitelists (Github Actions)' | |
- name: Set up Eslint | |
run: | | |
# Consistent with eslint version in Dockerfile | |
npm install eslint@7.5.0 -g && eslint --init | |
- name: Check installed module can run python linters | |
run: | | |
review test/resources/inspectors/python/case39_no_issues.py | |
- name: Check installed module can run java linters | |
run: | | |
review test/resources/inspectors/java/test_algorithm_with_scanner.java | |
- name: Check installed module can run js linters | |
run: | | |
review test/resources/inspectors/js/case0_no_issues.js | |
- name: Test with pytest | |
run: | | |
pytest -vv |