Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make circleci honour [skip ci] wherever is placed in the pr info (title, description) #2289

Merged
merged 7 commits into from
Oct 22, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,49 @@ defaults: &defaults
keys:
- v4-stack-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}

- run:
name: Skip ci setup
command: |
set +e
echo "CIRCLE_PULL_REQUEST: $CIRCLE_PULL_REQUEST"
if [[ ! -z $CIRCLE_PULL_REQUEST ]]; then
PULL_REQUEST_URL=${CIRCLE_PULL_REQUEST/github.com/api.github.com/repos}
PULL_REQUEST_URL=${PULL_REQUEST_URL/pull/pulls}
echo "PULL_REQUEST_URL: $PULL_REQUEST_URL"
SKIP_CI=$(curl $PULL_REQUEST_URL | grep -o "\\[skip ci\\]")
echo "SKIP_CI: $SKIP_CI"
fi
echo "export SKIP_CI=$SKIP_CI" >> $BASH_ENV

- run:
name: Stack upgrade
command: stack upgrade
command: |
if [[ -z "$SKIP_CI" ]]; then
stack upgrade
fi

- run:
name: Stack setup
command: stack -j2 --stack-yaml=${STACK_FILE} setup
command: |
if [[ -z "$SKIP_CI" ]]; then
stack -j2 --stack-yaml=${STACK_FILE} setup
fi

- run:
name: Build (we need the exe for tests)
# need j1, else ghc-lib-parser triggers OOM
command: stack -j1 --stack-yaml=${STACK_FILE} install --no-terminal
command: |
if [[ -z "$SKIP_CI" ]]; then
stack -j1 --stack-yaml=${STACK_FILE} install --no-terminal
fi
no_output_timeout: 30m

- run:
name: Build Testsuite without running it
command: stack -j1 --stack-yaml=${STACK_FILE} build --test --no-run-tests --no-terminal
command: |
if [[ -z "$SKIP_CI" ]]; then
stack -j1 --stack-yaml=${STACK_FILE} build --test --no-run-tests --no-terminal
fi
no_output_timeout: 30m

- store_artifacts:
Expand Down