Skip to content

Commit 681b95a

Browse files
committed
Swap to GHA.
1 parent bc34d73 commit 681b95a

File tree

6 files changed

+95
-141
lines changed

6 files changed

+95
-141
lines changed

.github/bors.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
4-
status = ["continuous-integration/travis-ci/push"]
4+
status = [
5+
"build-book",
6+
"build-chapter (05-led-roulette)",
7+
"build-chapter (06-hello-world)",
8+
"build-chapter (07-registers)",
9+
"build-chapter (08-leds-again)",
10+
"build-chapter (09-clocks-and-timers)",
11+
"build-chapter (11-usart)",
12+
"build-chapter (14-i2c)",
13+
"build-chapter (15-led-compass)",
14+
"build-chapter (16-punch-o-meter)",
15+
]

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ staging, trying, master ]
6+
pull_request:
7+
8+
jobs:
9+
# Check a build succeeds for each chapter that contains example code.
10+
build-chapter:
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
matrix:
14+
chapter:
15+
- 05-led-roulette
16+
- 06-hello-world
17+
- 07-registers
18+
- 08-leds-again
19+
- 09-clocks-and-timers
20+
- 11-usart
21+
- 14-i2c
22+
- 15-led-compass
23+
- 16-punch-o-meter
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions-rs/toolchain@v1
27+
with:
28+
profile: minimal
29+
toolchain: stable
30+
target: thumbv7em-none-eabihf
31+
- name: Build chapter
32+
working-directory: src/${{ matrix.chapter }}
33+
run: cargo build
34+
35+
# Build the book HTML itself and optionally publish it.
36+
build-book:
37+
runs-on: ubuntu-20.04
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions-rs/toolchain@v1
41+
with:
42+
profile: minimal
43+
toolchain: stable
44+
target: thumbv7em-none-eabihf
45+
46+
- name: Install Python dependencies
47+
run: |
48+
pip3 install --user python-dateutil linkchecker
49+
- name: Put pip binary directory into path
50+
run: echo "~/.local/bin" >> $GITHUB_PATH
51+
52+
- name: Cache Cargo installed binaries
53+
uses: actions/cache@v1
54+
id: cache-cargo
55+
with:
56+
path: ~/cargo-bin
57+
key: cache-cargo
58+
- name: Install mdbook
59+
if: steps.cache-cargo.outputs.cache-hit != 'true'
60+
uses: actions-rs/install@v0.1
61+
with:
62+
crate: mdbook
63+
version: latest
64+
- name: Copy mdbook to cache directory
65+
if: steps.cache-cargo.outputs.cache-hit != 'true'
66+
run: |
67+
mkdir ~/cargo-bin
68+
cp ~/.cargo/bin/mdbook ~/cargo-bin
69+
- name: Put new cargo binary directory into path
70+
run: echo "~/cargo-bin" >> $GITHUB_PATH
71+
72+
- name: Build book
73+
run: mkdir target && mdbook build
74+
- name: Check links
75+
run: linkchecker --ignore-url "print.html" book
76+
77+
- name: Deploy book
78+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
79+
uses: peaceiris/actions-gh-pages@v3
80+
with:
81+
github_token: ${{ secrets.GITHUB_TOKEN }}
82+
publish_dir: book
83+
force_orphan: true

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

ci/after-success.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

ci/install.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

ci/script.sh

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)