Skip to content

Commit

Permalink
ci: add code quality to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mariugul committed Jul 31, 2024
1 parent d87a972 commit b6bca17
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main

jobs:
code-quality:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch # skips commit to main check
PRE_COMMIT_CONFIG: code_quality/.pre-commit-config.yaml
VENV: venv
VENV_ACTIVATE: venv/bin/activate

steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # V4.1.7
with:
token: ${{ github.token }}

- name: Cache pre-commit dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # V4.0.2
id: cache
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles(env.PRE_COMMIT_CONFIG) }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install Requirements
run: python3 -m pip install docstr-coverage==2.3.2 pre-commit==3.7.1

- name: Code Quality
run: |
pre-commit run --config ${{ env.PRE_COMMIT_CONFIG }} --all-files
- name: Docstring Coverage
run: |
mkdir -p docs/badges/ docstr
mv code_quality/.docstr.yaml . # --config option didn't work
docstr-coverage 2>&1 | tee docstr/docstring_coverage.txt
ls docs/badges

0 comments on commit b6bca17

Please sign in to comment.