File tree 3 files changed +15
-17
lines changed
3 files changed +15
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
jobs :
13
13
ci :
14
14
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 }}
15
21
steps :
16
22
- uses : actions/checkout@v2
17
23
with :
18
24
# Set 0 to rebase later.
19
25
fetch-depth : 0
20
26
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
-
29
27
- name : Cache binaries
30
28
id : mdbook-cache
31
29
uses : actions/cache@v2
42
40
key : ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }}
43
41
44
42
- name : Check line lengths
45
- if : github.event_name != 'schedule '
43
+ if : github.event_name != 'push '
46
44
run : |
47
45
shopt -s globstar
48
46
MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md
62
60
cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }}
63
61
64
62
- name : Check build
65
- if : github.event_name != 'schedule '
63
+ if : github.event_name != 'push '
66
64
run : |
67
65
git switch -c ci
68
66
git fetch origin master
71
69
mdbook build
72
70
73
71
- 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'
75
73
run : |
76
74
mdbook build
77
75
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
10
10
echo " Doing full link check."
11
11
set -x
12
12
elif [ " $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
13
17
14
- CHANGED_FILES=$( git diff --name-only origin/master ... | tr ' \n' ' ' )
18
+ CHANGED_FILES=$( git diff --name-only $BASE_SHA ... | tr ' \n' ' ' )
15
19
FLAGS=" --no-cache -f $CHANGED_FILES "
16
20
17
- echo " Checking files changed in origin/master... : $CHANGED_FILES "
21
+ echo " Checking files changed from $BASE_SHA : $CHANGED_FILES "
18
22
set -x
19
23
else # running locally
20
24
COMMIT_RANGE=master...
You can’t perform that action at this time.
0 commit comments