Skip to content

Commit 5c0f4b3

Browse files
authored
Merge pull request #54 from eldruin/improve-ci
Improve CI
2 parents a4a1b2f + f5ae2ee commit 5c0f4b3

File tree

1 file changed

+19
-29
lines changed

1 file changed

+19
-29
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions-rs/toolchain@v1
16+
- uses: dtolnay/rust-toolchain@stable
1717
with:
18-
profile: minimal
19-
toolchain: stable
20-
target: thumbv7em-none-eabihf
18+
targets: thumbv7em-none-eabihf
2119
- name: Build book code
2220
working-directory: .
2321
run: cargo build
@@ -27,11 +25,9 @@ jobs:
2725
runs-on: ubuntu-24.04
2826
steps:
2927
- uses: actions/checkout@v4
30-
- uses: actions-rs/toolchain@v1
28+
- uses: dtolnay/rust-toolchain@stable
3129
with:
32-
profile: minimal
33-
toolchain: stable
34-
target: thumbv7em-none-eabihf
30+
targets: thumbv7em-none-eabihf
3531
- name: Build docs for micro:bit v2
3632
working-directory: .
3733
run: cargo doc
@@ -41,11 +37,9 @@ jobs:
4137
runs-on: ubuntu-24.04
4238
steps:
4339
- uses: actions/checkout@v4
44-
- uses: actions-rs/toolchain@v1
40+
- uses: dtolnay/rust-toolchain@stable
4541
with:
46-
profile: minimal
47-
toolchain: stable
48-
target: thumbv7em-none-eabihf
42+
targets: thumbv7em-none-eabihf
4943

5044
- name: Install Python dependencies
5145
run: |
@@ -62,36 +56,32 @@ jobs:
6256
restore-keys: |
6357
${{ runner.os }}-cargo-
6458
59+
- name: Put mdbook-epub where mdbook expects it
60+
if: steps.cache-cargo.outputs.cache-hit == 'true'
61+
run: |
62+
ls ~/cargo-bin
63+
mkdir -p ~/.cargo/bin
64+
cp ~/cargo-bin/mdbook-epub ~/.cargo/bin
65+
6566
- name: Install mdbook
6667
if: steps.cache-cargo.outputs.cache-hit != 'true'
67-
uses: actions-rs/[email protected]
68-
with:
69-
crate: mdbook
70-
version: 0.4.51
68+
run: cargo install --locked mdbook --version 0.4.51
7169

7270
- name: Install mdbook-epub
7371
if: steps.cache-cargo.outputs.cache-hit != 'true'
7472
run: cargo install --locked mdbook-epub --version 0.4.48
7573

76-
- name: Copy mdbook-epub to cache directory
77-
if: steps.cache-cargo.outputs.cache-hit != 'true'
78-
run: |
79-
mkdir -p ~/cargo-bin
80-
cp ~/.cargo/bin/mdbook-epub ~/cargo-bin
81-
82-
- name: Copy mdbook to cache directory
74+
- name: Copy mdbook and mdbook-epub to cache directory
8375
if: steps.cache-cargo.outputs.cache-hit != 'true'
8476
run: |
85-
mkdir -p ~/cargo-bin
77+
mkdir ~/cargo-bin
8678
cp ~/.cargo/bin/mdbook ~/cargo-bin
79+
cp ~/.cargo/bin/mdbook-epub ~/cargo-bin
80+
ls ~/cargo-bin
8781
8882
- name: Put new cargo binary directory into path
8983
run: echo "~/cargo-bin" >> $GITHUB_PATH
9084

91-
- name: Build EPUB
92-
working-directory: mdbook
93-
run: mdbook-epub -s
94-
9585
- name: Build book
9686
working-directory: mdbook
9787
run: mdbook build
@@ -106,7 +96,7 @@ jobs:
10696

10797
- name: Deploy book
10898
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
109-
uses: peaceiris/actions-gh-pages@v3
99+
uses: peaceiris/actions-gh-pages@v4
110100
with:
111101
github_token: ${{ secrets.GITHUB_TOKEN }}
112102
publish_dir: mdbook/book/html

0 commit comments

Comments
 (0)