40 lines
1020 B
YAML
40 lines
1020 B
YAML
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
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
|
|
test:cargo:
|
|
stage: test
|
|
script:
|
|
- rustc --version && cargo --version # Print version info for debugging
|
|
- cargo test --all --verbose
|
|
|
|
|
|
build:linux:
|
|
image: ekidd/rust-musl-builder
|
|
stage: build
|
|
script:
|
|
- cargo build --release
|
|
- tree
|
|
artifacts:
|
|
paths:
|
|
- x86_64-unknown-linux-musl/release/per
|
|
|
|
build:windows:
|
|
stage: build
|
|
script:
|
|
- 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
|
|
- apt-get update -yqq
|
|
- apt-get install -yqq mingw-w64
|
|
- rustup target add x86_64-pc-windows-gnu
|
|
- cargo build --release --target=x86_64-pc-windows-gnu
|
|
artifacts:
|
|
paths:
|
|
- target/x86_64-pc-windows-gnu/release/per.exe |