Skip to content
Snippets Groups Projects
Commit e626bd07 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

Check links in mdbook. Also changed image to debian bookworm.

parent 208e2108
No related branches found
No related tags found
No related merge requests found
# # Official language image. Look for the different tagged releases at:
# # https://hub.docker.com/r/library/rust/tags/
# image: "rust:1.70-alpine3.17"
# # Use cargo to test the project
# before_script:
# - apk add --no-cache musl-dev curl
# - mkdir -p $HOME/.cargo/bin
# - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-musl.tar.gz | tar -xz --directory=$HOME/.cargo/bin
# - curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.7/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip -o mdbook-linkcheck.zip
# - unzip mdbook-linkcheck.zip -d $HOME/.cargo/bin && chmod +x $HOME/.cargo/bin/mdbook-linkcheck
# # - cargo install mdbook-linkcheck
# - rustup component add rustfmt
# - rustup component add clippy
# - export PATH=$PATH:$HOME/.cargo/bin
# ##
# ## Install ssh-agent if not already installed, it is required by Docker.
# ##
# - 'which ssh-agent || (apk add --update openssh-client)'
# - 'which rsync || (apk add --update rsync)'
# - 'which chmod || (apk add --update chmod)'
# ##
# ## Run ssh-agent (inside the build environment)
# ##
# - eval $(ssh-agent -s)
# ##
# ## Give the right permissions, otherwise ssh-add will refuse to add files
# ## Add the SSH key stored in SSH_PRIVATE_KEY file type CI/CD variable to the agent store
# ##
# - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# ##
# ## Create the SSH directory and give it the right permissions
# ##
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
# ##
# ## Assuming you created the SSH_KNOWN_HOSTS file type CI/CD variable, uncomment the
# ## following two lines.
# ##
# - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
image: "rust:1.70-alpine3.17"
image: "rust:1-slim-bookworm"
# Use cargo to test the project
before_script:
- apk add --no-cache musl-dev curl
- apt update && apt upgrade -y
- apt install curl unzip -y
- mkdir -p $HOME/.cargo/bin
- curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-musl.tar.gz | tar -xz --directory=$HOME/.cargo/bin
- export PATH=$PATH:$HOME/.cargo/bin
- curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.7/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip -o mdbook-linkcheck.zip
- unzip mdbook-linkcheck.zip -d $HOME/.cargo/bin && chmod +x $HOME/.cargo/bin/mdbook-linkcheck
# - cargo install mdbook-linkcheck
- rustup component add rustfmt
- rustup component add clippy
- export PATH=$PATH:$HOME/.cargo/bin
##
## Install ssh-agent if not already installed, it is required by Docker.
##
- 'which ssh-agent || (apk add --update openssh-client)'
- 'which rsync || (apk add --update rsync)'
- 'which chmod || (apk add --update chmod)'
- 'which ssh-agent || (apt install openssh-client -y)'
- 'which rsync || (apt install rsync -y)'
- 'which chmod || (apt install chmod -y)'
##
## Run ssh-agent (inside the build environment)
##
......@@ -44,6 +90,10 @@ test:cargo:
stage: test
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo clippy --version
- rustfmt --version
- ls -ltr $HOME/.cargo/bin
- mdbook --version && mdbook-linkcheck --version
build:codes:
stage: build
......
......@@ -7,3 +7,16 @@ title = "Rust-101: Université d'été"
[output.html.playground]
editable = true
[output.linkcheck]
# Should we check links on the internet? Enabling this option adds a
# non-negligible performance impact
follow-web-links = true
# How should warnings be treated?
#
# - "warn" will emit warning messages
# - "error" treats all warnings as errors, failing the linkcheck
# - "ignore" will ignore warnings, suppressing diagnostic messages and allowing
# the linkcheck to continuing
warning-policy = "error"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment