Skip to content

Commit

Permalink
try re-inventing test
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Dec 22, 2023
1 parent 89d3a40 commit 71f374d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ jobs:

- name: Run pipreqs
run: pipreqs --savepath pipreqs.txt

- name: Compare requirements
run: |
echo "=== pipreqs.txt contents: ==="
cat pipreqs.txt
echo "=== requirements.txt contents: ==="
cat requirements.txt
echo "=== diff contents: ==="
diff=$(diff requirements.txt pipreqs.txt)
echo $diff
exit 1
# Extract and sort package names
awk '{print $1}' $1 | sort -u > "$1".compare
awk -F'==' '{print $1}' $2 | sort -u > "$2".compare
# Compare package lists
if cmp -s "$1".compare "$2".compare
then
echo "Requirements are the same"
exit 0
else
echo "Requirements are different"
exit 1
fi

0 comments on commit 71f374d

Please sign in to comment.