matrix-modbot/.gitlab-ci.yml

35 lines
761 B
YAML

.caching_rust: &caching_rust
cache:
paths:
- .cargo/
- .cache/sccache
- target/x86_64-unknown-linux-musl/release/material
stages:
- test
- build
run_tests_cargo:
stage: test
image: "rust:latest"
# Use cargo to test the project
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo build
- cargo test --workspace --verbose
docker-build-main:
# Official docker image.
image: "docker:latest"
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- main