-
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
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
21ae3aa
feat: update lint and test workflows
vtnphan a97be3f
feat: add tests
vtnphan f9bdf91
feat: update CI
vtnphan 8abc251
fix: improve lint
vtnphan 367763c
fix: improve lint
vtnphan ddb6e04
fix: update requirements-dev.txt
vtnphan a0bb969
fix: update .pre-commit-config.yaml
vtnphan d6fa9f2
fix: update requirements-dev.txt
vtnphan a51ac2d
fix: update readme
vtnphan b8c573f
fix: update .github/workflows/test-coverage.yml
vtnphan d5a3209
fix: update .github/workflows/lint.yml
vtnphan ef500d7
fix: improve tests
vtnphan 9f5beff
fix: update ci
vtnphan a3e068b
fix: improve lint
vtnphan dd387a3
fix: update ci
vtnphan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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 | ||
This file contains hidden or 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,37 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| ruff: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install UV | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync --all-extras | ||
|
|
||
| - name: Run Ruff | ||
| run: uv run ruff check app tests | ||
|
|
||
| - name: Run Black | ||
| run: uv run black --check app tests | ||
|
|
||
| - name: Run MyPy | ||
| run: uv run mypy app --ignore-missing-imports |
This file contains hidden or 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,60 @@ | ||
| 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 }} | ||
|
|
||
| - name: Install UV | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync --all-extras | ||
|
|
||
| - 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: | | ||
| uv run pytest --cov=app --cov-report=xml --cov-report=term-missing --cov-report=html -v | ||
|
|
||
| - name: Check coverage threshold (90%) | ||
| run: | | ||
| uv run coverage report --fail-under=90 | ||
|
|
||
| - name: Coverage summary | ||
| uses: irongut/CodeCoverageSummary@v1.3.0 | ||
| 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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,41 @@ | ||
| # Python | ||
| .venv/ | ||
| venv/ | ||
| env/ | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| *.so | ||
| *.egg | ||
| *.egg-info/ | ||
| dist/ | ||
| build/ | ||
| *.whl | ||
|
|
||
| # Environment | ||
| .env | ||
| *.log | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Testing | ||
| .pytest_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
| .tox/ | ||
| .hypothesis/ | ||
|
|
||
| # IDE | ||
| .DS_Store | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # Logs | ||
| *.log | ||
| logs/ | ||
|
|
||
| # UV | ||
| # Note: uv.lock is tracked for reproducibility | ||
| # .python-version is tracked if using specific Python version |
This file contains hidden or 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,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.14.10 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --exit-non-zero-on-fix] | ||
|
|
||
| - repo: https://github.com/psf/black | ||
| rev: 24.1.1 | ||
vtnphan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| - id: black | ||
| language_version: python3.11 | ||
vtnphan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.8.0 | ||
vtnphan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| - id: mypy | ||
| additional_dependencies: [types-httpx] | ||
| args: [--ignore-missing-imports] | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.