Skip to content

Commit

Permalink
Merge pull request NationalGenomicsInfrastructure#429 from kedhammar/…
Browse files Browse the repository at this point in the history
…improve-ci

Improve ci
  • Loading branch information
kedhammar authored Jul 1, 2024
2 parents cf2d277 + f8b7432 commit 4b69b0f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,26 @@ jobs:
with:
python-version: "3.10"

- name: Install pipreqs
run: pip install pipreqs

- name: Install requirements
run: pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run pipreqs
run: pipreqs --savepath pipreqs.txt taca
run: |
pipreqs --savepath pipreqs.txt taca 2>&1 | tee pipreqs_output.log
if grep -q 'WARNING: Package .* does not exist or network problems' pipreqs_output.log; then
missing_packages=$(grep 'WARNING: Package .* does not exist or network problems' pipreqs_output.log | sed -E 's/.*Package "(.*)" does not exist.*/\1/')
echo "ERROR: Add unresolved packages to requirements. Missing package(s): $missing_packages. Example: '<pkg> @ git+https://github.com/<author>/<repo>.git'"
exit 1
fi
- name: Compare requirements
run: |
# Extract and sort package names
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' requirements.txt | sort -u > requirements.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' pipreqs.txt | sort -u > pipreqs.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' requirements.txt | tr '[:upper:]' '[:lower:]' | sort -u > requirements.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' pipreqs.txt | tr '[:upper:]' '[:lower:]' | sort -u > pipreqs.compare
# Compare package lists
if cmp -s requirements.compare pipreqs.compare
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
run: pip install -e .
- name: pytest
# Options are configured in pyproject.toml
run: pytest
run: pytest --cov=genologics --cov-report=xml
- name: CodeCov
run: |
# Replace `linux` below with the appropriate OS
# Options are `alpine`, `linux`, `macos`, `windows`
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# TACA Version Log

## 20240701.1

Improve CI for pipreqs check and pytest/codecov

## 20240617.1

Run mypy for entire repo regardless of depth.
Expand Down

0 comments on commit 4b69b0f

Please sign in to comment.