skip codacy coverage if PR is from a fork #712
Workflow file for this run
This file contains hidden or 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: Coding Style | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| mypy: | |
| name: mypy | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-devel.txt', '**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install python3-setuptools libldap2-dev libsasl2-dev | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-devel.txt | |
| - name: Create required directories | |
| run: | | |
| sudo mkdir -p /var/log/orthos2 | |
| sudo mkdir -p /var/lib/orthos2/database | |
| - name: Create required files | |
| run: | | |
| sudo touch /var/log/orthos2/default.log | |
| sudo touch /var/lib/orthos2/database/db.sqlite3 | |
| - name: Adjust permissions for files | |
| run: | | |
| CURRENT_USER=$(whoami) | |
| CURRENT_GROUP=$(id -gn) | |
| sudo chown -R $CURRENT_USER:$CURRENT_GROUP /var/lib/orthos2 | |
| sudo chown -R $CURRENT_USER:$CURRENT_GROUP /var/log/orthos2 | |
| - name: Run mypy for server | |
| run: mypy orthos2 | |
| - name: Run mypy for CL | |
| run: mypy --strict cli | |
| isort: | |
| name: isort | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - uses: isort/isort-action@master | |
| with: | |
| configuration: "--check-only --diff --profile black" | |
| requirementsFiles: "pyproject.toml" | |
| black: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: psf/black@stable | |
| # Version see in .pre-commit-config.yaml | |
| with: | |
| options: | | |
| --include '(\.pyi?|\.ipynb|cli/orthos2)$' --check --diff --safe --verbose | |
| version: "22.3.0" | |
| pylint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-devel.txt', '**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pylint | |
| - name: Analysing the code with pylint (server) | |
| run: | | |
| pylint --rcfile=.pylintrc --fail-under=10 orthos2 | |
| - name: Analysing the code with pylint (CLI) | |
| run: | | |
| pylint --rcfile=.pylintrc --fail-under=10 cli/orthos2 | |
| pylint --rcfile=.pylintrc --fail-under=10 cli/tests | |
| flake8: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-devel.txt', '**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install flake8 | |
| - name: Analysing the code with flake8 | |
| run: | | |
| flake8 orthos2 | |
| django-admin: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-devel.txt', '**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install python3-setuptools libldap2-dev libsasl2-dev | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements-devel.txt | |
| - name: Create required directories | |
| run: | | |
| sudo mkdir -p /var/log/orthos2 | |
| sudo mkdir -p /var/lib/orthos2/database | |
| - name: Create required files | |
| run: | | |
| sudo touch /var/log/orthos2/default.log | |
| sudo touch /var/lib/orthos2/database/db.sqlite3 | |
| - name: Adjust permissions for files | |
| run: | | |
| CURRENT_USER=$(whoami) | |
| CURRENT_GROUP=$(id -gn) | |
| sudo chown -R $CURRENT_USER:$CURRENT_GROUP /var/lib/orthos2 | |
| sudo chown -R $CURRENT_USER:$CURRENT_GROUP /var/log/orthos2 | |
| - name: Analysing the code with "django-admin check" | |
| run: | | |
| python3 manage.py check | |
| prettier: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| - name: Install Prettier | |
| run: | | |
| npm install --save-dev --save-exact prettier prettier-plugin-jinja-template | |
| - name: Run Prettier | |
| run: | | |
| npx prettier --check *.json ./**/*.json |