2019-03-26 15:18:42 +01:00
|
|
|
image: "rust: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:
|
|
|
|
#- apt-get update -yqq
|
|
|
|
#- apt-get install -yqq mingw-w64
|
|
|
|
|
2019-03-28 19:16:21 +01:00
|
|
|
|
|
|
|
variables:
|
|
|
|
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
|
|
|
|
2019-03-28 19:02:01 +01:00
|
|
|
cache:
|
2019-03-28 19:08:35 +01:00
|
|
|
key: all
|
2019-03-28 19:02:01 +01:00
|
|
|
paths:
|
2019-03-28 19:16:21 +01:00
|
|
|
- cargo/
|
2019-03-28 19:02:01 +01:00
|
|
|
- target/
|
|
|
|
|
|
|
|
|
2019-03-26 16:35:48 +01:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
|
2019-03-26 15:18:42 +01:00
|
|
|
test:cargo:
|
2019-03-26 16:35:48 +01:00
|
|
|
stage: test
|
2019-03-26 15:18:42 +01:00
|
|
|
script:
|
|
|
|
- rustc --version && cargo --version # Print version info for debugging
|
2019-03-28 19:03:21 +01:00
|
|
|
- cargo test
|
2019-03-28 18:45:00 +01:00
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit: output.xml
|
2019-03-26 15:18:42 +01:00
|
|
|
|
2019-03-26 15:25:53 +01:00
|
|
|
|
2019-03-27 01:08:30 +01:00
|
|
|
|
|
|
|
build:linux-glibc:
|
2019-03-26 16:35:48 +01:00
|
|
|
stage: build
|
2019-03-26 15:18:42 +01:00
|
|
|
script:
|
2019-03-27 01:08:30 +01:00
|
|
|
- cargo build --release
|
2019-03-26 15:18:42 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-03-27 01:14:26 +01:00
|
|
|
- target/release/per
|
2019-03-26 15:25:53 +01:00
|
|
|
|
|
|
|
build:windows:
|
2019-03-26 16:35:48 +01:00
|
|
|
stage: build
|
2019-03-26 15:25:53 +01:00
|
|
|
script:
|
2019-03-26 15:36:02 +01:00
|
|
|
- mkdir .cargo && echo -e "[target.x86_64-pc-windows-gnu]\nlinker = \"x86_64-w64-mingw32-gcc\"\nar = \"x86_64-w64-mingw32-gcc-ar\"" > .cargo/config
|
2019-03-26 15:25:53 +01:00
|
|
|
- apt-get update -yqq
|
|
|
|
- apt-get install -yqq mingw-w64
|
2019-03-26 15:29:30 +01:00
|
|
|
- rustup target add x86_64-pc-windows-gnu
|
2019-03-26 15:25:53 +01:00
|
|
|
- cargo build --release --target=x86_64-pc-windows-gnu
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-03-27 01:08:30 +01:00
|
|
|
- target/x86_64-pc-windows-gnu/release/per.exe
|
|
|
|
|
|
|
|
build:linux-musl:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- rustup target add x86_64-unknown-linux-musl
|
|
|
|
- cargo build --release --target x86_64-unknown-linux-musl
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/x86_64-unknown-linux-musl/release/per
|