Skip to content

Commit

Permalink
Remove conditionally-skip command, as it doesn't work
Browse files Browse the repository at this point in the history
It skips based on the current commit,
not the diff of the entire PR.
There doesn't look to be a good workaround to this,
though maybe this would help:
https://javorszky.co.uk/2019/03/11/set-up-circle-ci-to-run-phpcs-on-only-changed-files-in-a-pr/
I opened a feature request to
CircleCI to enable this to work.
  • Loading branch information
kienstra committed Nov 2, 2020
1 parent c8d17c4 commit 5c8b60c
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ commands:
ACTUAL_SIGNATURE=$(php -r "echo hash_file('sha384', 'composer-setup.php');")
[[ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]] && sudo php composer-setup.php --install-dir=/bin --version=1.10.16 --filename=composer || exit 1
conditionally-skip:
description: "Skip if the current commit has no change in relevant directories"
parameters:
directories:
type: string
steps:
- run:
name: Checking whether relevant files were changed
command: |
sudo apt-get update && sudo apt-get install jq
echo "Here is the ORG: $ORG and the PROJECT: $PROJECT and the PR number: $CIRCLE_PR_NUMBER"
API_URL=url="https://api.github.com/repos/$ORG/$PROJECT/pulls/$CIRCLE_PR_NUMBER
TARGET_BRANCH=$( curl "$url" | jq '.base.ref' | tr -d '"')
echo "The target branch URL is: $TARGET_BRANCH"
CHANGED_FILES="$( git diff << pipeline.git.branch >> $TARGET_BRANCH --name-only --diff-filter=ACMRT << parameters.directories >> )"
if [ -z "$CHANGED_FILES" ] && [ -z "$CIRCLE_TAG" ]; then echo "No change to relevant file, exiting job" && circleci-agent step halt; fi
jobs:
lint:
executor:
Expand Down Expand Up @@ -74,8 +57,6 @@ jobs:
MYSQL_ROOT_PASSWORD: wordpress
steps:
- checkout
- conditionally-skip:
directories: php tests/php
- run:
name: Installing the mysqli extension
command: sudo docker-php-ext-install mysqli
Expand Down Expand Up @@ -104,8 +85,6 @@ jobs:
executor: php
steps:
- checkout
- conditionally-skip:
directories: js tests/js
- node/install:
node-version: lts
- run: npm ci && npm run test:js
Expand All @@ -115,8 +94,6 @@ jobs:
image: ubuntu-1604:202004-01
steps:
- checkout
- conditionally-skip:
directories: php js css tests/e2e
- run: sudo apt-get update && sudo apt-get install php php-xml
- install-composer
- node/install:
Expand Down

0 comments on commit 5c8b60c

Please sign in to comment.