File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 98
98
working-directory : ./mdbook-spec
99
99
run : cargo fmt --check
100
100
101
+ preview :
102
+ if : github.event_name == 'pull_request'
103
+ runs-on : ubuntu-latest
104
+ steps :
105
+ - uses : actions/checkout@master
106
+ - name : Update rustup
107
+ run : rustup self update
108
+ - name : Install Rust
109
+ run : |
110
+ rustup set profile minimal
111
+ rustup toolchain install nightly
112
+ rustup default nightly
113
+ - name : Install mdbook
114
+ run : |
115
+ mkdir bin
116
+ curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
117
+ echo "$(pwd)/bin" >> $GITHUB_PATH
118
+ - name : Build the book
119
+ env :
120
+ SPEC_RELATIVE : 0
121
+ run : mdbook build --dest-dir dist/preview-${{ github.event.pull_request.number }}
122
+ - name : Upload artifact
123
+ uses : actions/upload-artifact@v4
124
+ with :
125
+ name : preview-${{ github.event.pull_request.number }}
126
+ overwrite : true
127
+ path : dist
128
+
101
129
# The success job is here to consolidate the total success/failure state of
102
130
# all other jobs. This job is then included in the GitHub branch protection
103
131
# rule which prevents merges unless all other jobs are passing. This makes
@@ -110,6 +138,7 @@ jobs:
110
138
- code-tests
111
139
- style-tests
112
140
- mdbook-spec
141
+ # preview is explicitly excluded here since it doesn't run on merge
113
142
runs-on : ubuntu-latest
114
143
steps :
115
144
- run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
You can’t perform that action at this time.
0 commit comments