Skip to content

Commit

Permalink
CI: Simplify CircleCI always running --check-urls-reachable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Apr 11, 2024
1 parent 5a00180 commit e2aa752
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,11 @@ jobs:
name: Check description files
command: |
pip install joblib retry
python ./scripts/check_description_files.py --check-dependencies . $(find . -maxdepth 1 -name "*.s4ext")
check-new-description-files:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Lookup base branch (Workaround the lack of CIRCLE_BASE_BRANCH env. variable)
# See https://discuss.circleci.com/t/how-to-get-the-pull-request-upstream-branch/5496/2
command: |
if [[ $CIRCLE_PULL_REQUEST != "" ]]; then
for base_branch in origin/main $(git branch -r | grep -E "origin\/[0-9](\.[0-9])+" | sort -r); do
differences=$(git diff $base_branch --name-only)
if [[ $differences != "" ]]; then
break
fi
done
else
base_branch=$CIRCLE_BRANCH
fi
echo "export BASE_BRANCH=\"$base_branch\"" >> $BASH_ENV
- run:
name: Check new description files
command: |
# ignore grep exit code if no description files were added
set +e
echo "BASE_BRANCH is [$BASE_BRANCH]"
echo "CIRCLE_BRANCH is [$CIRCLE_BRANCH]"
# Collect list of new *.s4ext files
added=$(git diff $BASE_BRANCH --diff-filter=A --name-only | grep -E "^[^\/]+\.s4ext$")
echo "added [$added]"
# Run checks
if [[ $added != "" ]]; then
pip install joblib retry
python ./scripts/check_description_files.py --check-urls-reachable $added
fi
python ./scripts/check_description_files.py --check-urls-reachable --check-dependencies . $(find . -maxdepth 1 -name "*.s4ext")
workflows:
version: 2
test:
jobs:
- check-filenames
- check-description-files
- check-new-description-files

0 comments on commit e2aa752

Please sign in to comment.