Skip to content

Commit 1a5fec3

Browse files
committed
Port to GitHub Actions
Most of the Rust project has moved over to Actions, but we were still on Travis. This sets up the needed Actions for us.
1 parent df7b104 commit 1a5fec3

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/main.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Run tests
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- name: Update rustup
11+
run: rustup self update
12+
- name: Install Rust
13+
run: |
14+
rustup set profile minimal
15+
rustup toolchain install 1.41.0 -c rust-docs
16+
rustup default 1.41.0
17+
- name: Install mdbook
18+
run: |
19+
mkdir bin
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
21+
echo "##[add-path]$(pwd)/bin"
22+
- name: Report versions
23+
run: |
24+
rustup --version
25+
rustc -Vv
26+
mdbook --version
27+
- name: Run tests
28+
run: mdbook test
29+
lint:
30+
name: Run lints
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@master
34+
- name: Update rustup
35+
run: rustup self update
36+
- name: Install Rust
37+
run: |
38+
rustup set profile minimal
39+
rustup toolchain install nightly -c rust-docs
40+
rustup default nightly
41+
- name: Install mdbook
42+
run: |
43+
mkdir bin
44+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
45+
echo "##[add-path]$(pwd)/bin"
46+
- name: Report versions
47+
run: |
48+
rustup --version
49+
rustc -Vv
50+
mdbook --version
51+
- name: Spellcheck
52+
run: bash ci/spellcheck.sh list
53+
- name: Lint for local file paths
54+
run: |
55+
mdbook build
56+
cargo run --bin lfp src
57+
- name: Validate references
58+
run: bash ci/validate.sh
59+
- name: Check for broken links
60+
run: |
61+
curl -sSLo linkcheck.sh \
62+
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
63+
# Cannot use --all here because of the generated redirect pages aren't available.
64+
sh linkcheck.sh book

ci/validate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
for file in src/*.md ; do
2+
echo Checking references in $file
3+
cargo run --quiet --bin link2print < $file > /dev/null
4+
done

0 commit comments

Comments
 (0)