-
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.
- Loading branch information
Showing
14 changed files
with
224 additions
and
3,962 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,2 @@ | ||
input/* | ||
output/* |
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,69 @@ | ||
name: Tests and Style | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: [3.11.4] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Switch to Current Branch | ||
run: git checkout ${{ env.BRANCH }} | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -e . | ||
- name: Run flake8 | ||
run: | | ||
pip install flake8 | ||
# stop the build if there are flake8 errors | ||
flake8 . --count --show-source --statistics | ||
- name: Run unit tests | ||
run: | | ||
pip install pytest | ||
python -m pytest src/jp2_remediator/tests/unit | ||
- name: Run coverage | ||
run: | | ||
pip install coverage | ||
python -m coverage run -p -m pytest src/jp2_remediator/tests/unit | ||
python -m coverage combine | ||
python -m coverage report -m --skip-covered | ||
python -m coverage xml | ||
# Fetch base branch for comparison (e.g., main) | ||
- name: Fetch base branch | ||
run: git fetch origin main | ||
|
||
# Compare coverage with the base branch | ||
- name: Compare coverage | ||
run: | | ||
pip install diff-cover | ||
git checkout main | ||
python -m coverage run -p -m pytest src/jp2_remediator/tests/unit | ||
python -m coverage xml -o coverage-base.xml | ||
git checkout - | ||
python diff-cover --compare-branch=main coverage.xml | ||
# Fail if coverage decreases | ||
- name: Fail if coverage decreases | ||
run: | | ||
python diff-cover --compare-branch=main coverage.xml --fail-under=100 | ||
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
*~ | ||
*.swp | ||
|
||
logs/ | ||
|
||
input/* | ||
output/* | ||
.coverage | ||
coverage.* | ||
|
||
|
||
dist/* | ||
*/*.egg-info/* | ||
__pycache__ | ||
|
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
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
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,10 @@ | ||
boto3==1.35.39 | ||
botocore==1.35.39 | ||
jmespath==1.0.1 | ||
jpylyzer==2.2.1 | ||
project-paths==1.1.1 | ||
python-dateutil==2.9.0.post0 | ||
s3transfer==0.10.3 | ||
six==1.16.0 | ||
toml==0.10.2 | ||
urllib3==2.2.3 |
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
Oops, something went wrong.