-
Notifications
You must be signed in to change notification settings - Fork 12
chore: upgrade CI/CD pipeline with comprehensive testing and code qua… #40
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
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
618f059
chore: upgrade CI/CD pipeline with comprehensive testing and code qua…
cadd44d
docs: update CHANGELOG with CI/CD improvements (issue #12)
ec71ce9
ruff impro
rilma 2872f41
ruff fix
rilma a78179b
mypy fixes
rilma e0511b4
single Python version only
rilma 2fe1a2d
Update .github/workflows/smoke.yml
rilma e1ad012
Update .github/workflows/smoke.yml
rilma a358f77
Update README.md
rilma 9d10895
Update .github/workflows/smoke.yml
rilma b41257b
Update pyproject.toml
rilma 39e2059
Update .github/workflows/smoke.yml
rilma e654ff1
fix: use os.path.commonpath for path traversal check and raise ValueE…
Copilot e18b276
fix: handle ValueError from os.path.commonpath for cross-drive paths
Copilot e39217a
test: mock wget.download in test_retrieve to avoid network calls
Copilot 0ad436a
test: address code review - explicit buf.seek(0) and assert mock call…
Copilot f03e10a
unit-testing
rilma 51ca90e
update log
rilma c8d0cb7
Update pyiri2016/api/update.py
rilma 67a182b
Update .github/workflows/smoke.yml
rilma dfa4d22
Fix variable shadowing in is_within_directory inner function
Copilot b6f1d8b
Update pyproject.toml
rilma 3d1e664
Update Makefile
rilma 250c619
Update .github/workflows/smoke.yml
rilma 86840ed
Add negative test cases for path-traversal protection in update.retri…
Copilot ecd31b3
Fix tarfile symlink/hardlink escape vulnerability in safe_extract
Copilot 82316fa
fix test cases
rilma 77c8b80
fix deprecation warnings due to Latex characters
rilma 7517370
figures
rilma 6117e49
format
rilma 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 |
|---|---|---|
| @@ -1,25 +1,82 @@ | ||
| name: Smoke | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| smoke: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.11"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gfortran cmake ninja-build | ||
|
|
||
| - name: Install dependencies | ||
| run: make dev | ||
|
|
||
| - name: Compile check (smoke test) | ||
| run: make smoke | ||
|
|
||
| - name: Generate coverage report | ||
| run: make coverage | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| fail_ci_if_error: false | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install ruff | ||
|
|
||
| - name: Lint with ruff | ||
| run: ruff check pyiri2016 tests settings examples scripts | ||
|
|
||
| - name: Format check with ruff | ||
| run: ruff format pyiri2016 tests settings examples scripts --check | ||
|
|
||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gfortran cmake | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install mypy numpy | ||
|
|
||
| - name: Install dependencies and run smoke test | ||
| run: make dev && make smoke | ||
| - name: Type check with mypy | ||
| run: mypy --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,26 @@ | ||
| # Pre-commit hooks for pyIRI2016 | ||
| # Install with: pre-commit install | ||
| # Run manually: pre-commit run --all-files | ||
|
|
||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.0 | ||
| hooks: | ||
| - id: ruff | ||
| name: ruff check | ||
| args: [--fix] | ||
| - id: ruff-format | ||
| name: ruff format | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.19.1 | ||
| hooks: | ||
| - id: mypy | ||
| name: mypy type check | ||
| additional_dependencies: [ | ||
| "numpy", | ||
| ] | ||
| args: [ | ||
| --ignore-missing-imports, | ||
| ] | ||
| exclude: "^(build|dist|source|\.venv)" |
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
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.
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.