Skip to content

Commit

Permalink
ci: Early exit for doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed Jan 15, 2021
1 parent 7bd5fec commit 35889e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GitHub Actions
name: GitHub Actions (Build)

on:
push:
Expand All @@ -19,6 +19,7 @@ jobs:
env:
GH_YML_JOBNAME: ${{ matrix.jobname }}
GH_YML_OS: Linux
GH_SHA_BEFORE: ${{ github.event.before }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -73,6 +74,7 @@ jobs:
env:
GH_YML_JOBNAME: ${{ matrix.jobname }}
GH_YML_OS: Linux
GH_SHA_BEFORE: ${{ github.event.before }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -117,6 +119,7 @@ jobs:
env:
GH_YML_JOBNAME: ${{ matrix.jobname }}
GH_YML_OS: Linux
GH_SHA_BEFORE: ${{ github.event.before }}

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Formatting
name: GitHub Actions (Formatting)

on:
push:
Expand Down
21 changes: 21 additions & 0 deletions scripts/ci/gh-actions/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash --login

#set -x

if [[ "${GITHUB_JOB}" =~ emu ]]
then
export CI_SITE_NAME="GitHub Actions (QEMU)"
Expand Down Expand Up @@ -82,6 +84,25 @@ echo "**********Env Begin**********"
env | sort
echo "**********Env End************"

echo "**********Doc Check Begin************"
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]
then
git fetch origin ${GITHUB_BASE_REF}
REF0=$(git merge-base origin/${GITHUB_BASE_REF} HEAD)
else
REF0=${GH_SHA_BEFORE}
fi
NFILES=$(git diff --name-only ${REF0}..HEAD | wc -l)
NNOTDOCS=$(git diff --name-only ${REF0}..HEAD | grep -v '^docs/' | wc -l)
echo "${NFILES} files changed, ${NNOTDOCS} not in docs/."
git diff --name-only ${REF0}..HEAD
if [ ${NFILES} -ne 0 -a ${NNOTDOCS} -eq 0 ]
then
echo "Only changes in docs/; skipping all other CI actions."
exit 0
fi
echo "**********Doc Check End**************"

echo "**********CTest Begin**********"
${CTEST} --version
echo ${CTEST} -VV -S ${CTEST_SCRIPT} -Ddashboard_full=OFF ${CTEST_STEP_ARGS}
Expand Down

0 comments on commit 35889e4

Please sign in to comment.