-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from TPAFS/add_format_workflow
Add linting and formatting workflow
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: lint_and_format | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- "opened" | ||
- "synchronize" | ||
- "reopened" | ||
branches: | ||
- "main" | ||
- "dev" | ||
push: | ||
branches: | ||
- "main" | ||
- "dev" | ||
jobs: | ||
lint-and-format: | ||
name: Lint and format code. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: 'pip' | ||
python-version: '3.10' | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
- name: Setup Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Lint and Format | ||
run: pre-commit run --show-diff-on-failure --color=always --all-files |
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