35 lines
1 KiB
YAML
35 lines
1 KiB
YAML
name: Book
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # To push a branch
|
|
pages: write # To push to a GitHub Pages site
|
|
id-token: write # To update the deployment status
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.4'
|
|
- name: Install latest mdbook
|
|
run: |
|
|
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
|
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
|
|
mkdir mdbook
|
|
curl -sSL $url | tar -xz --directory=./mdbook
|
|
echo `pwd`/mdbook >> $GITHUB_PATH
|
|
- name: Test Book
|
|
run: |
|
|
cd book
|
|
export CARGO_MANIFEST_DIR=$(pwd)
|
|
cargo build
|
|
mdbook test -L target/debug/deps/
|