mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 15:08:52 +00:00
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
# Setup a cache to cache job parts between jobs to ensure faster builds
|
|
cache:
|
|
key: "$CI_JOB_NAME"
|
|
untracked: true
|
|
paths:
|
|
- $HOME/.cargo/
|
|
- target/
|
|
|
|
# Set any required environment variables here
|
|
variables:
|
|
RUST_BACKTRACE: "FULL"
|
|
|
|
image: rust:latest
|
|
|
|
stages:
|
|
- install
|
|
- test
|
|
- deploy
|
|
|
|
install:
|
|
stage: install
|
|
script:
|
|
- rustc --version # triggering installation
|
|
|
|
check:
|
|
stage: test
|
|
before_script:
|
|
- rustup component add rustfmt clippy
|
|
- cargo install cargo-audit
|
|
script:
|
|
- cargo check --verbose
|
|
- cargo fmt -- --check
|
|
- cargo clippy -- -D warnings
|
|
- cargo audit
|
|
|
|
debug:
|
|
stage: test
|
|
before_script:
|
|
- (echo 'Acquire::http { Proxy "http://10.22.0.2:3142"; }' | tee -a /etc/apt/apt.conf.d/01proxy) && apt update && apt install -yy clang gcc-riscv64-linux-gnu g++-riscv64-linux-gnu qemu-user-static
|
|
script:
|
|
- RUST_MIN_STACK=8388608 cargo test -- --nocapture
|
|
|
|
release:
|
|
stage: test
|
|
before_script:
|
|
- (echo 'Acquire::http { Proxy "http://10.22.0.2:3142"; }' | tee -a /etc/apt/apt.conf.d/01proxy) && apt update && apt install -yy clang gcc-riscv64-linux-gnu g++-riscv64-linux-gnu qemu-user-static
|
|
script:
|
|
- RUST_MIN_STACK=8388608 cargo test --release -- --nocapture
|
|
|
|
pages:
|
|
stage: deploy
|
|
before_script:
|
|
# - apt update && apt install -yy
|
|
script:
|
|
- cargo doc
|
|
- mkdir -p public && cp -r target/doc/* public
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
rules:
|
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|