image: registry.gitlab.com/veloren/veloren-docker-ci:latest variables: GIT_STRATEGY: fetch GIT_DEPTH: 3 GIT_CLEAN_FLAGS: -f stages: - optional-builds - check-compile - post before_script: - source $HOME/.cargo/env - df -h - free -h - gcc -v - cargo --version - export DISABLE_GIT_LFS_CHECK=true - find assets | md5sum # -- optional build .optional-debug: &optional-debug stage: optional-builds tags: - veloren-docker except: - schedules when: manual optional-debug:linux: <<: *optional-debug cache: key: "cache-linux-debug-v2" paths: - ./target script: - cd voxygen && VELOREN_ASSETS=assets cargo build --verbose && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --verbose && cd .. - cp target/debug/veloren-server-cli $CI_PROJECT_DIR - cp target/debug/veloren-voxygen $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli - veloren-voxygen - assets/ - LICENSE expire_in: 1 week optional-debug:windows: <<: *optional-debug cache: key: "cache-windows-debug-v2" paths: - ./target script: - cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu && cd .. - cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe $CI_PROJECT_DIR - cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli.exe - veloren-voxygen.exe - assets/ - LICENSE expire_in: 1 week .optional-release: &optional-release stage: optional-builds tags: - veloren-docker except: - schedules when: manual optional-release:linux: <<: *optional-release cache: key: "cache-linux-release-v2" paths: - ./target script: - cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --release && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --release && cd .. - cp target/release/veloren-server-cli $CI_PROJECT_DIR - cp target/release/veloren-voxygen $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli - veloren-voxygen - assets/ - LICENSE expire_in: 1 week optional-release:windows: <<: *optional-release cache: key: "cache-windows-release-v2" paths: - ./target script: - cd voxygen && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu --release && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --verbose --target=x86_64-pc-windows-gnu --release && cd .. - cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR - cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli.exe - veloren-voxygen.exe - assets/ - LICENSE expire_in: 1 week # -- # -- check check: stage: check-compile cache: key: "cache-linux-debug-v2" paths: - ./target tags: - veloren-docker script: - RUSTFLAGS="-D warnings" cargo check --verbose code-quality: stage: check-compile cache: key: "cache-linux-debug-v2" paths: - ./target tags: - veloren-docker script: - cargo clippy -- --warn clippy::all - cargo fmt --all -- --check security: stage: check-compile allow_failure: true tags: - veloren-docker script: - cargo install cargo-audit - cargo audit # -- # -- post build unittests: stage: post cache: key: "cache-linux-debug-v2" paths: - ./target when: delayed start_in: 5 seconds tags: - veloren-docker script: - cargo test benchmarks: stage: post cache: key: "cache-linux-release-v2" paths: - ./target when: delayed start_in: 5 seconds tags: - veloren-docker script: - cargo bench allow_failure: true linux: stage: post cache: key: "cache-linux-release-v2" paths: - ./target when: delayed start_in: 5 seconds only: refs: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+\.[0-9]+/ - /^master$/ tags: - veloren-docker script: - cd voxygen && VELOREN_ASSETS=assets cargo build --release && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --release && cd .. - cp -r target/release/veloren-server-cli $CI_PROJECT_DIR - cp -r target/release/veloren-voxygen $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli - veloren-voxygen - assets/ - LICENSE expire_in: 1 week windows: stage: post cache: key: "cache-windows-release-v2" paths: - ./target when: delayed start_in: 5 seconds only: refs: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+\.[0-9]+/ - /^master$/ tags: - veloren-docker script: - cd voxygen && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu --release && cd .. - cd server-cli && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu --release && cd .. - cp -r target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe $CI_PROJECT_DIR - cp -r target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe $CI_PROJECT_DIR artifacts: paths: - veloren-server-cli.exe - veloren-voxygen.exe - assets/ - LICENSE expire_in: 1 week # --