Check Code Quality #278
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: Check Code Quality | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 4 * * *' | |
permissions: | |
actions: write # Needed for skip-duplicate-jobs job | |
contents: read | |
jobs: | |
# Special job which automatically cancels old runs for the same branch, prevents runs for the | |
# same file set which has already passed, etc. | |
pre_job: | |
name: Skip Duplicate Jobs Pre Job | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0 | |
with: | |
cancel_others: 'true' | |
github_token: ${{ github.token }} | |
build: | |
runs-on: ubuntu-latest | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: 'pip' | |
- name: Install pre-commit | |
run: | | |
make dev-install-dependencies-for-development | |
make dev-install-dependencies-lib | |
- name: Install pre-commit hooks | |
run: | | |
pre-commit install | |
- name: Run pre-commit | |
run: | | |
pre-commit run -a | |
# - name: Code tests | |
# run: | | |
# make test | |
# - name: Code coverage | |
# run: | | |
# make coverage | |
# - name: Upload coverage reports to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# fail_ci_if_error: true | |
# verbose: true |