forked from AllenCellModeling/cyto-dl
-
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.
Add code quality workflows for main branch and pull requests (AllenCe…
- Loading branch information
Showing
3 changed files
with
44 additions
and
10 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,16 @@ | ||
# Same as `code-quality-pr.yaml` but triggered on commit | ||
# to main branch and runs on all files (instead of only the changed ones) | ||
|
||
name: Code Quality On Push | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |
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,27 @@ | ||
# This workflow finds which files were changed, prints them, and then | ||
# runs `pre-commit` on those files. | ||
|
||
# Inspired by the sktime library: | ||
# https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml | ||
|
||
name: Code Quality On PR | ||
|
||
on: | ||
pull_request: | ||
branches: [main, "release/*"] | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- id: file_changes | ||
uses: trilom/[email protected] | ||
with: | ||
output: " " | ||
- name: List changed files | ||
run: echo '${{ steps.file_changes.outputs.files}}' | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --files ${{ steps.file_changes.outputs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ jobs: | |
run: | | ||
pytest -v | ||
# upload code coverate report | ||
# upload code coverage report | ||
code-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -67,12 +67,3 @@ jobs: | |
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
|
||
# check code formatting | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |