-
Notifications
You must be signed in to change notification settings - Fork 0
feat: update lint and test workflows #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
21ae3aa
a97be3f
f9bdf91
8abc251
367763c
ddb6e04
a0bb969
d6fa9f2
a51ac2d
b8c573f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <!-- | ||
| Thank you for contributing! Please fill out the sections below to help maintainers review your change faster. | ||
| Delete any sections that don't apply. | ||
| --> | ||
|
|
||
| # Pull Request | ||
|
|
||
| ## Summary | ||
| [SBP-XXX](https://biocloud.atlassian.net/browse/SBP-XXX) <Provide a short description of the changes in this pull request and the motivation behind them.> | ||
|
|
||
| ## Changes | ||
| - <What changed? (files, components, behavior)> | ||
| - <Any migration or backwards-incompatible changes?> | ||
|
|
||
| ## How to Test | ||
| <Provide step-by-step instructions for testing the changes locally. Include any setup, commands, or screenshots where helpful.> | ||
|
|
||
| ## Type of change | ||
| - [ ] Bug fix (non-breaking change which fixes an issue) | ||
| - [ ] New feature (non-breaking change which adds functionality) | ||
| - [ ] Breaking change (fix or feature that would cause existing functionality to change) | ||
| - [ ] Documentation update | ||
|
|
||
| ## Checklist | ||
| - [ ] I have added tests that prove my fix is effective or that my feature works | ||
| - [ ] I have added or updated documentation where necessary | ||
| - [ ] I have run linting and unit tests locally | ||
| - [ ] The code follows the project's style guidelines | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||
| name: Lint | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| branches: [main, workflows] | ||||||||||||||
| pull_request: | ||||||||||||||
| branches: [main, workflows] | ||||||||||||||
|
Comment on lines
+5
to
+7
|
||||||||||||||
| branches: [main, workflows] | |
| pull_request: | |
| branches: [main, workflows] | |
| branches: [main] | |
| pull_request: | |
| branches: [main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right - you generally only need CI to run on pushes or pull requests to main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types of requirements should be in requirements-dev.txt so you can run the same checks locally (or in pyproject.toml as discussed below)
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| cache-dependency-path: requirements.txt | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install -r requirements-dev.txt | ||
|
|
||
| - name: Run tests with coverage | ||
| env: | ||
| ALLOWED_ORIGINS: http://localhost | ||
| SEQERA_API_URL: https://example.com/api | ||
| SEQERA_ACCESS_TOKEN: test-token | ||
| WORK_SPACE: demo-workspace | ||
| COMPUTE_ID: compute-123 | ||
| WORK_DIR: /tmp/work | ||
| run: | | ||
| pytest --cov=app --cov-report=xml --cov-report=term-missing --cov-report=html -v | ||
|
|
||
| - name: Check coverage threshold (90%) | ||
| run: | | ||
| coverage report --fail-under=90 | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| if: matrix.python-version == '3.11' | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
|
Comment on lines
+48
to
+55
|
||
|
|
||
| - name: Coverage summary | ||
| uses: irongut/[email protected] | ||
| if: matrix.python-version == '3.11' | ||
| with: | ||
| filename: coverage.xml | ||
| badge: true | ||
| fail_below_min: true | ||
| format: markdown | ||
| hide_branch_rate: false | ||
| hide_complexity: true | ||
| indicators: true | ||
| thresholds: "90 90" | ||
| output: both | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||
| # Pre-commit hooks configuration | ||||||
| repos: | ||||||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||||||
| rev: v5.0.0 | ||||||
| hooks: | ||||||
| - id: trailing-whitespace | ||||||
| - id: end-of-file-fixer | ||||||
| - id: check-yaml | ||||||
| - id: check-added-large-files | ||||||
| - id: check-json | ||||||
| - id: check-toml | ||||||
| - id: check-merge-conflict | ||||||
| - id: debug-statements | ||||||
|
|
||||||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||||||
| rev: v0.1.15 | ||||||
|
||||||
| rev: v0.1.15 | |
| rev: v0.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder link format uses 'biocloud.atlassian.net', which may be specific to the organization. Ensure this is the correct Jira instance URL for the project and that contributors have access to it.