Skip to content

Commit

Permalink
Merge pull request #133 from Datenschule/loud-errors
Browse files Browse the repository at this point in the history
Fail CI if test_changes errors
  • Loading branch information
k-nut authored Feb 10, 2025
2 parents 656d656 + e9f7e79 commit 06b8b44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ scrapy crawl <state_name>
You can deploy the scrapers directly on a server or using Docker. The resulting Docker
image needs to be run with the `DATABASE_URL` environment variable pointing to a Postgres
instance. You can for example use docker-compose to achieve this. See the
[docker-compose file at jedeschule-api](https://github.com/codeforberlin/jedeschule-api/blob/master/docker-compose.yml)
[docker-compose file at jedeschule-api](https://github.com/codeforberlin/jedeschule-api/blob/main/docker-compose.yml)
for inspiration.

## Updating data on jedeschule.codefor.de
Expand Down
17 changes: 11 additions & 6 deletions test_changes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -euxo pipefail

if [ $CI ]
then
Expand All @@ -11,13 +11,18 @@ fi

echo "Using head reference: ${HEAD_REF}"

CHANGED_SCRAPERS=$(git whatchanged --name-only --pretty="" origin/master..${HEAD_REF} |
grep spiders |
grep -v helper |
CHANGED_SCRAPERS=$(git whatchanged --name-only --pretty="" origin/main..${HEAD_REF} |
grep spiders || true |
grep -v helper || true |
sed 's/jedeschule\/spiders\///' |
sed 's/\.py//' |
sed 's/_/\-/' |
uniq)
sed 's/_/\-/' |
uniq)

if [ -z "$CHANGED_SCRAPERS" ]; then
echo "No scrapers were changed"
exit 0
fi

for SPIDER in $CHANGED_SCRAPERS
do
Expand Down

0 comments on commit 06b8b44

Please sign in to comment.