File tree Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1212jobs :
1313 ci :
1414 runs-on : ubuntu-latest
15+ env :
16+ MDBOOK_VERSION : 0.4.7
17+ MDBOOK_LINKCHECK_VERSION : 0.7.2
18+ MDBOOK_TOC_VERSION : 0.6.1
19+ DEPLOY_DIR : book/html
20+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
1521 steps :
1622 - uses : actions/checkout@v2
1723 with :
1824 # Set 0 to rebase later.
1925 fetch-depth : 0
2026
21- - name : Read .env
22- run : |
23- . ./.env
24- echo "MDBOOK_VERSION=${MDBOOK_VERSION}" >> $GITHUB_ENV
25- echo "MDBOOK_LINKCHECK_VERSION=${MDBOOK_LINKCHECK_VERSION}" >> $GITHUB_ENV
26- echo "MDBOOK_TOC_VERSION=${MDBOOK_TOC_VERSION}" >> $GITHUB_ENV
27- echo "DEPLOY_DIR=${DEPLOY_DIR}" >> $GITHUB_ENV
28-
2927 - name : Cache binaries
3028 id : mdbook-cache
3129 uses : actions/cache@v2
4240 key : ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }}
4341
4442 - name : Check line lengths
45- if : github.event_name != 'schedule '
43+ if : github.event_name != 'push '
4644 run : |
4745 shopt -s globstar
4846 MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md
6260 cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }}
6361
6462 - name : Check build
65- if : github.event_name != 'schedule '
63+ if : github.event_name != 'push '
6664 run : |
6765 git switch -c ci
6866 git fetch origin master
7169 mdbook build
7270
7371 - name : Deploy to gh-pages
74- if : github.event_name == 'schedule ' && github.repository == 'rust-lang/rustc-dev-guide'
72+ if : github.event_name == 'push ' && github.repository == 'rust-lang/rustc-dev-guide'
7573 run : |
7674 mdbook build
7775 touch "${{ env.DEPLOY_DIR }}/.nojekyll"
Original file line number Diff line number Diff line change @@ -10,11 +10,15 @@ if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job
1010 echo " Doing full link check."
1111 set -x
1212elif [ " $CI " = " true" ] ; then # running in PR CI build
13+ if [ -z " $BASE_SHA " ]; then
14+ echo " error: unexpected state: BASE_SHA must be non-empty in CI"
15+ exit 1
16+ fi
1317
14- CHANGED_FILES=$( git diff --name-only origin/master ... | tr ' \n' ' ' )
18+ CHANGED_FILES=$( git diff --name-only $BASE_SHA ...$GITHUB_SHA | tr ' \n' ' ' )
1519 FLAGS=" --no-cache -f $CHANGED_FILES "
1620
17- echo " Checking files changed in origin/master ...: $CHANGED_FILES "
21+ echo " Checking files changed in $BASE_SHA ...$GITHUB_SHA : $CHANGED_FILES "
1822 set -x
1923else # running locally
2024 COMMIT_RANGE=master...
You can’t perform that action at this time.
0 commit comments