default: # Official language image. Look for the different tagged releases at: # https://hub.docker.com/r/library/rust/tags/ image: "rust:latest" # Optional: Pick zero or more services to be used on all builds. # Only needed when using a docker container to run your tests in. # Check out: https://docs.gitlab.com/ee/ci/services/index.html # services: # - mysql:latest # - redis:latest # - postgres:latest # Optional: Install a C compiler, cmake and git into the container. # You will often need this when you (or any of your dependencies) depends on C code. before_script: # avoid /n -> /r/n conversion on windows - git config --global core.autocrlf false # - apt-get update -yqq # - apt-get install -yqq --no-install-recommends build-essential stages: - test - build - deploy # Test the project for linux environment #test_linux: # stage: test # tags: # - opossum # script: # - export HTTPS_PROXY=lxproxy01.gsi.de:3128 # - export HTTP_PROXY=lxproxy01.gsi.de:3128 # - export https_proxy=lxproxy01.gsi.de:3128 # - export http_proxy=lxproxy01.gsi.de:3128 # - rustup default nightly # - cargo install junitify # - rustc --version && cargo --version # Print version info for debugging # # - cargo test --workspace # - cargo test -- --format=json -Z unstable-options --report-time | junitify --out $CI_PROJECT_DIR/tests/ # artifacts: # when: always # reports: # junit: $CI_PROJECT_DIR/tests/*.xml test_windows: stage: test tags: - windows script: - $Env:CARGO_HOME="C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo" - $Env:CARGO_TARGET_DIR="C:\Users\ueisenb\Appdata\Local\0_gsi_executables\gitlab-runner\target" - $Env:Path += ";C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo\bin" # - rustup default nightly # - cargo install junitify # junitify does not find some files under windows ??? - cargo test # -- --format=json -Z unstable-options --report-time | junitify --out $CI_PROJECT_DIR\tests\ rules: - if: '$CI_COMMIT_REF_PROTECTED == "true"' # artifacts: # when: always # reports: # junit: $CI_PROJECT_DIR/tests/*.xml clippy: stage: test tags: - windows script: - $Env:CARGO_HOME="C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo" - $Env:CARGO_TARGET_DIR="C:\Users\ueisenb\Appdata\Local\0_gsi_executables\gitlab-runner\target" - $Env:Path += ";C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo\bin" - cargo clippy --workspace - cargo clean dependencies: - test_windows rules: - if: '$CI_COMMIT_REF_PROTECTED == "true"' # Build the main application (currently mostly useless) build-windows: stage: build tags: - windows script: - $Env:CARGO_HOME="C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo" - $Env:CARGO_TARGET_DIR="C:\Users\ueisenb\Appdata\Local\0_gsi_executables\gitlab-runner\target" - $Env:Path += ";C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo\bin" - cargo build --release dependencies: - test_windows rules: - if: '$CI_COMMIT_REF_PROTECTED == "true"' # Build the main application for linux #build-linux: # stage: build # tags: # - opossum # script: # - export HTTPS_PROXY=lxproxy01.gsi.de:3128 # - export HTTP_PROXY=lxproxy01.gsi.de:3128 # - export https_proxy=lxproxy01.gsi.de:3128 # - export http_proxy=lxproxy01.gsi.de:3128 # - cargo build --release # dependencies: # - test:cargo # Build API documentation build-doc: stage: build tags: - windows script: - $Env:CARGO_HOME="C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo" - $Env:CARGO_TARGET_DIR="C:\Users\ueisenb\Appdata\Local\0_gsi_executables\gitlab-runner\target" - $Env:Path += ";C:\Users\ueisenb\AppData\Local\0_gsi_executables\.cargo\bin" - cargo doc --no-deps dependencies: - test_windows rules: - if: '$CI_COMMIT_REF_PROTECTED == "true"' #deploy: # stage: deploy # script: echo "Define your deployment script!" # environment: production