Merge branch 'ci-tag-jobs-with-docker' into 'master'

Better CI (run on faster CI hosts, incremental release builds, thin-lto)

See merge request famedly/conduit!118
This commit is contained in:
Timo Kösters 2021-07-12 20:35:00 +00:00
commit 0eec1cc696

View file

@ -9,10 +9,12 @@ variables:
CACHE_COMPRESSION_LEVEL: fastest CACHE_COMPRESSION_LEVEL: fastest
test:cargo: test:cargo:
stage: "test" stage: "test"
needs: [] needs: []
image: "rust:latest" image: "rust:latest"
tags: ["docker"]
variables: variables:
CARGO_HOME: "cargohome" CARGO_HOME: "cargohome"
cache: cache:
@ -43,6 +45,7 @@ test:cargo:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
interruptible: true interruptible: true
image: "rust:latest" image: "rust:latest"
tags: ["docker"]
cache: cache:
paths: paths:
- cargohome - cargohome
@ -57,6 +60,10 @@ test:cargo:
- "apt-get install -yqq --no-install-recommends $NEEDED_PACKAGES" - "apt-get install -yqq --no-install-recommends $NEEDED_PACKAGES"
- "rustup target add $TARGET" - "rustup target add $TARGET"
script: script:
# Set some cargo tuning here, because targets overwrite the 'variables'
- "export CARGO_INCREMENTAL=true"
- "export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16"
- "export CARGO_PROFILE_RELEASE_LTO=thin"
- time cargo build --target $TARGET --release - time cargo build --target $TARGET --release
- 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"' - 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"'
artifacts: artifacts:
@ -103,6 +110,7 @@ build:cargo:aarch64-unknown-linux-gnu:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
interruptible: true interruptible: true
image: "rust:latest" image: "rust:latest"
tags: ["docker"]
cache: cache:
paths: paths:
- cargohome - cargohome
@ -149,6 +157,7 @@ publish:package:
rules: rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
image: curlimages/curl:latest image: curlimages/curl:latest
tags: ["docker"]
variables: variables:
GIT_STRATEGY: "none" # Don't need a clean copy of the code, we just operate on artifacts GIT_STRATEGY: "none" # Don't need a clean copy of the code, we just operate on artifacts
script: script: