2021-06-01 01:58:50 +01:00
|
|
|
stages:
|
|
|
|
- build
|
2021-07-19 16:18:25 +01:00
|
|
|
- build docker image
|
2021-07-19 09:23:04 +01:00
|
|
|
- test
|
2021-07-11 12:43:48 +01:00
|
|
|
- upload artifacts
|
2021-05-13 08:57:11 +01:00
|
|
|
|
2021-03-13 19:00:13 +00:00
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
2021-05-13 08:57:11 +01:00
|
|
|
FF_USE_FASTZIP: 1
|
2021-07-02 13:26:26 +01:00
|
|
|
CACHE_COMPRESSION_LEVEL: fastest
|
2022-01-25 21:36:51 +00:00
|
|
|
# Docker in Docker
|
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
DOCKER_DRIVER: overlay2
|
2021-03-13 19:00:13 +00:00
|
|
|
|
2021-07-02 13:26:26 +01:00
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
# Cargo: Compiling for different architectures #
|
|
|
|
# --------------------------------------------------------------------- #
|
2021-06-01 01:58:50 +01:00
|
|
|
|
2021-07-02 13:26:26 +01:00
|
|
|
.build-cargo-shared-settings:
|
2021-06-01 01:58:50 +01:00
|
|
|
stage: "build"
|
|
|
|
needs: []
|
2021-07-02 13:26:26 +01:00
|
|
|
rules:
|
2021-09-02 16:17:51 +01:00
|
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "next"'
|
2021-11-21 17:34:08 +00:00
|
|
|
- if: "$CI_COMMIT_TAG"
|
2022-02-01 23:51:38 +00:00
|
|
|
- if: '($CI_MERGE_REQUEST_APPROVED == "true") || $BUILD_EVERYTHING' # Once MR is approved, test all builds. Or if BUILD_EVERYTHING is set.
|
2021-06-01 01:58:50 +01:00
|
|
|
interruptible: true
|
2022-02-01 23:51:38 +00:00
|
|
|
image: "registry.gitlab.com/jfowl/conduit-containers/rust-with-tools:latest"
|
2021-07-12 20:58:35 +01:00
|
|
|
tags: ["docker"]
|
2022-01-22 16:34:30 +00:00
|
|
|
services: ["docker:dind"]
|
2021-08-22 22:05:32 +01:00
|
|
|
variables:
|
2022-01-23 20:19:19 +00:00
|
|
|
SHARED_PATH: $CI_PROJECT_DIR/shared
|
2021-11-21 17:34:08 +00:00
|
|
|
CARGO_PROFILE_RELEASE_LTO: "true"
|
|
|
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
|
2021-12-14 10:16:02 +00:00
|
|
|
CARGO_INCREMENTAL: "false" # https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
|
2021-07-02 13:26:26 +01:00
|
|
|
before_script:
|
|
|
|
- 'echo "Building for target $TARGET"'
|
2022-01-22 16:34:30 +00:00
|
|
|
- "rustup show && rustc --version && cargo --version" # Print version info for debugging
|
|
|
|
# fix cargo and rustup mounts from this container (https://gitlab.com/gitlab-org/gitlab-foss/-/issues/41227)
|
2022-02-01 23:51:38 +00:00
|
|
|
- "mkdir -p $SHARED_PATH/cargo"
|
|
|
|
- "cp -r $CARGO_HOME/bin $SHARED_PATH/cargo"
|
|
|
|
- "cp -r $RUSTUP_HOME $SHARED_PATH"
|
|
|
|
- "export CARGO_HOME=$SHARED_PATH/cargo RUSTUP_HOME=$SHARED_PATH/rustup"
|
2022-01-25 21:36:51 +00:00
|
|
|
# If provided, bring in caching through sccache, which uses an external S3 endpoint to store compilation results.
|
2022-02-01 23:51:38 +00:00
|
|
|
- if [ -n "${SCCACHE_ENDPOINT}" ]; then export RUSTC_WRAPPER=/sccache; fi
|
2022-01-23 14:10:42 +00:00
|
|
|
script:
|
2022-01-22 16:34:30 +00:00
|
|
|
# cross-compile conduit for target
|
2022-02-01 23:51:38 +00:00
|
|
|
- 'time cross build --target="$TARGET" --locked --release'
|
2022-01-23 14:10:42 +00:00
|
|
|
- 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"'
|
2022-01-23 18:24:36 +00:00
|
|
|
# print information about linking for debugging
|
2022-02-01 23:51:38 +00:00
|
|
|
- "file conduit-$TARGET" # print file information
|
2022-01-23 18:24:36 +00:00
|
|
|
- 'readelf --dynamic conduit-$TARGET | sed -e "/NEEDED/q1"' # ensure statically linked
|
2022-01-22 16:34:30 +00:00
|
|
|
cache:
|
|
|
|
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
|
2022-02-01 23:51:38 +00:00
|
|
|
key: "cargo-cache-$TARGET"
|
2022-01-23 14:10:42 +00:00
|
|
|
paths:
|
|
|
|
- $SHARED_PATH/cargo/registry/index
|
|
|
|
- $SHARED_PATH/cargo/registry/cache
|
|
|
|
- $SHARED_PATH/cargo/git/db
|
2021-09-02 16:17:51 +01:00
|
|
|
artifacts:
|
|
|
|
expire_in: never
|
2021-07-02 13:26:26 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
build:release:cargo:x86_64-unknown-linux-musl-with-debug:
|
2021-07-02 13:26:26 +01:00
|
|
|
extends: .build-cargo-shared-settings
|
2021-06-01 01:58:50 +01:00
|
|
|
variables:
|
2021-11-21 17:34:08 +00:00
|
|
|
CARGO_PROFILE_RELEASE_DEBUG: 2 # Enable debug info for flamegraph profiling
|
|
|
|
TARGET: "x86_64-unknown-linux-musl"
|
|
|
|
after_script:
|
|
|
|
- "mv ./conduit-x86_64-unknown-linux-musl ./conduit-x86_64-unknown-linux-musl-with-debug"
|
2021-07-19 18:42:25 +01:00
|
|
|
artifacts:
|
2021-11-21 17:34:08 +00:00
|
|
|
name: "conduit-x86_64-unknown-linux-musl-with-debug"
|
2021-07-19 18:42:25 +01:00
|
|
|
paths:
|
2021-11-21 17:34:08 +00:00
|
|
|
- "conduit-x86_64-unknown-linux-musl-with-debug"
|
|
|
|
expose_as: "Conduit for x86_64-unknown-linux-musl-with-debug"
|
2021-07-02 13:26:26 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
build:release:cargo:x86_64-unknown-linux-musl:
|
2021-07-02 13:26:26 +01:00
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
variables:
|
2021-11-21 17:34:08 +00:00
|
|
|
TARGET: "x86_64-unknown-linux-musl"
|
2021-07-19 18:42:25 +01:00
|
|
|
artifacts:
|
2021-11-21 17:34:08 +00:00
|
|
|
name: "conduit-x86_64-unknown-linux-musl"
|
2021-07-19 18:42:25 +01:00
|
|
|
paths:
|
2021-11-21 17:34:08 +00:00
|
|
|
- "conduit-x86_64-unknown-linux-musl"
|
|
|
|
expose_as: "Conduit for x86_64-unknown-linux-musl"
|
2021-07-02 13:26:26 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
build:release:cargo:arm-unknown-linux-musleabihf:
|
2021-07-02 13:26:26 +01:00
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
variables:
|
2021-11-21 17:34:08 +00:00
|
|
|
TARGET: "arm-unknown-linux-musleabihf"
|
2021-07-19 18:42:25 +01:00
|
|
|
artifacts:
|
2021-11-21 17:34:08 +00:00
|
|
|
name: "conduit-arm-unknown-linux-musleabihf"
|
2021-07-19 18:42:25 +01:00
|
|
|
paths:
|
2021-11-21 17:34:08 +00:00
|
|
|
- "conduit-arm-unknown-linux-musleabihf"
|
|
|
|
expose_as: "Conduit for arm-unknown-linux-musleabihf"
|
2021-07-02 13:26:26 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
build:release:cargo:armv7-unknown-linux-musleabihf:
|
2021-07-19 09:47:31 +01:00
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
variables:
|
2021-11-21 17:34:08 +00:00
|
|
|
TARGET: "armv7-unknown-linux-musleabihf"
|
2021-07-19 18:42:25 +01:00
|
|
|
artifacts:
|
2021-11-21 17:34:08 +00:00
|
|
|
name: "conduit-armv7-unknown-linux-musleabihf"
|
2021-07-19 18:42:25 +01:00
|
|
|
paths:
|
2021-11-21 17:34:08 +00:00
|
|
|
- "conduit-armv7-unknown-linux-musleabihf"
|
|
|
|
expose_as: "Conduit for armv7-unknown-linux-musleabihf"
|
2021-08-13 16:20:40 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
build:release:cargo:aarch64-unknown-linux-musl:
|
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
variables:
|
|
|
|
TARGET: "aarch64-unknown-linux-musl"
|
|
|
|
artifacts:
|
|
|
|
name: "conduit-aarch64-unknown-linux-musl"
|
|
|
|
paths:
|
|
|
|
- "conduit-aarch64-unknown-linux-musl"
|
|
|
|
expose_as: "Conduit for aarch64-unknown-linux-musl"
|
2021-08-13 16:20:40 +01:00
|
|
|
|
|
|
|
.cargo-debug-shared-settings:
|
|
|
|
extends: ".build-cargo-shared-settings"
|
|
|
|
rules:
|
2022-02-04 17:43:13 +00:00
|
|
|
- when: "always"
|
2021-08-13 16:20:40 +01:00
|
|
|
cache:
|
2021-11-21 17:34:08 +00:00
|
|
|
key: "build_cache--$TARGET--$CI_COMMIT_BRANCH--debug"
|
2021-08-13 16:20:40 +01:00
|
|
|
script:
|
2022-01-23 14:10:42 +00:00
|
|
|
# cross-compile conduit for target
|
2022-02-01 23:51:38 +00:00
|
|
|
- 'time time cross build --target="$TARGET" --locked'
|
2021-08-13 16:20:40 +01:00
|
|
|
- 'mv "target/$TARGET/debug/conduit" "conduit-debug-$TARGET"'
|
2022-01-23 18:24:36 +00:00
|
|
|
# print information about linking for debugging
|
2022-02-01 23:51:38 +00:00
|
|
|
- "file conduit-debug-$TARGET" # print file information
|
2022-01-23 18:24:36 +00:00
|
|
|
- 'readelf --dynamic conduit-debug-$TARGET | sed -e "/NEEDED/q1"' # ensure statically linked
|
2021-09-02 16:17:51 +01:00
|
|
|
artifacts:
|
|
|
|
expire_in: 4 weeks
|
2021-08-13 16:20:40 +01:00
|
|
|
|
|
|
|
build:debug:cargo:x86_64-unknown-linux-musl:
|
|
|
|
extends: ".cargo-debug-shared-settings"
|
|
|
|
variables:
|
|
|
|
TARGET: "x86_64-unknown-linux-musl"
|
|
|
|
artifacts:
|
|
|
|
name: "conduit-debug-x86_64-unknown-linux-musl"
|
|
|
|
paths:
|
|
|
|
- "conduit-debug-x86_64-unknown-linux-musl"
|
|
|
|
expose_as: "Conduit DEBUG for x86_64-unknown-linux-musl"
|
|
|
|
|
2021-07-19 16:18:25 +01:00
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
# Create and publish docker image #
|
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
|
|
|
|
.docker-shared-settings:
|
|
|
|
stage: "build docker image"
|
2021-11-21 17:34:08 +00:00
|
|
|
image: jdrouet/docker-with-buildx:stable
|
2021-07-19 16:18:25 +01:00
|
|
|
tags: ["docker"]
|
2021-11-21 17:34:08 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
2021-07-19 16:18:25 +01:00
|
|
|
needs:
|
2021-08-13 16:20:40 +01:00
|
|
|
- "build:release:cargo:x86_64-unknown-linux-musl"
|
2021-11-21 17:34:08 +00:00
|
|
|
- "build:release:cargo:arm-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:armv7-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:aarch64-unknown-linux-musl"
|
|
|
|
variables:
|
2021-11-25 22:36:44 +00:00
|
|
|
PLATFORMS: "linux/arm/v6,linux/arm/v7,linux/arm64,linux/amd64"
|
2021-11-21 17:34:08 +00:00
|
|
|
DOCKER_FILE: "docker/ci-binaries-packaging.Dockerfile"
|
2021-11-25 22:36:44 +00:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- docker_cache
|
|
|
|
key: "$CI_JOB_NAME"
|
2021-11-21 17:34:08 +00:00
|
|
|
before_script:
|
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
# Only log in to Dockerhub if the credentials are given:
|
|
|
|
- if [ -n "${DOCKER_HUB}" ]; then docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" "$DOCKER_HUB"; fi
|
2021-07-19 16:18:25 +01:00
|
|
|
script:
|
2021-11-21 17:34:08 +00:00
|
|
|
# Prepare buildx to build multiarch stuff:
|
|
|
|
- docker context create 'ci-context'
|
|
|
|
- docker buildx create --name 'multiarch-builder' --use 'ci-context'
|
|
|
|
# Copy binaries to their docker arch path
|
|
|
|
- mkdir -p linux/ && mv ./conduit-x86_64-unknown-linux-musl linux/amd64
|
|
|
|
- mkdir -p linux/arm/ && mv ./conduit-arm-unknown-linux-musleabihf linux/arm/v6
|
|
|
|
- mkdir -p linux/arm/ && mv ./conduit-armv7-unknown-linux-musleabihf linux/arm/v7
|
2021-11-25 22:36:44 +00:00
|
|
|
- mv ./conduit-aarch64-unknown-linux-musl linux/arm64
|
|
|
|
- 'export CREATED=$(date -u +''%Y-%m-%dT%H:%M:%SZ'') && echo "Docker image creation date: $CREATED"'
|
|
|
|
# Build and push image:
|
2021-07-19 16:18:25 +01:00
|
|
|
- >
|
2021-11-21 17:34:08 +00:00
|
|
|
docker buildx build
|
|
|
|
--pull
|
|
|
|
--push
|
2021-11-25 22:36:44 +00:00
|
|
|
--cache-from=type=local,src=$CI_PROJECT_DIR/docker_cache
|
|
|
|
--cache-to=type=local,dest=$CI_PROJECT_DIR/docker_cache
|
|
|
|
--build-arg CREATED=$CREATED
|
2021-07-19 16:18:25 +01:00
|
|
|
--build-arg VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml)
|
2021-08-31 17:03:44 +01:00
|
|
|
--build-arg "GIT_REF=$CI_COMMIT_SHORT_SHA"
|
2021-11-21 17:34:08 +00:00
|
|
|
--platform "$PLATFORMS"
|
2021-11-25 22:36:44 +00:00
|
|
|
--tag "$TAG"
|
|
|
|
--tag "$TAG-alpine"
|
|
|
|
--tag "$TAG-commit-$CI_COMMIT_SHORT_SHA"
|
2021-11-21 17:34:08 +00:00
|
|
|
--file "$DOCKER_FILE" .
|
|
|
|
|
2021-11-25 22:36:44 +00:00
|
|
|
docker:next:gitlab:
|
2021-11-21 17:34:08 +00:00
|
|
|
extends: .docker-shared-settings
|
2021-07-19 16:18:25 +01:00
|
|
|
rules:
|
2021-09-02 16:17:51 +01:00
|
|
|
- if: '$CI_COMMIT_BRANCH == "next"'
|
2021-11-21 17:34:08 +00:00
|
|
|
variables:
|
2021-11-25 22:36:44 +00:00
|
|
|
TAG: "$CI_REGISTRY_IMAGE/matrix-conduit:next"
|
|
|
|
|
|
|
|
docker:next:dockerhub:
|
|
|
|
extends: .docker-shared-settings
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "next" && $DOCKER_HUB'
|
|
|
|
variables:
|
|
|
|
TAG: "$DOCKER_HUB_IMAGE/matrixconduit/matrix-conduit:next"
|
2021-09-02 16:17:51 +01:00
|
|
|
|
2021-11-25 22:36:44 +00:00
|
|
|
docker:master:gitlab:
|
2021-09-02 16:17:51 +01:00
|
|
|
extends: .docker-shared-settings
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
2021-11-21 17:34:08 +00:00
|
|
|
variables:
|
2021-11-25 22:36:44 +00:00
|
|
|
TAG: "$CI_REGISTRY_IMAGE/matrix-conduit:latest"
|
|
|
|
|
|
|
|
docker:master:dockerhub:
|
|
|
|
extends: .docker-shared-settings
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "master" && $DOCKER_HUB'
|
|
|
|
variables:
|
|
|
|
TAG: "$DOCKER_HUB_IMAGE/matrixconduit/matrix-conduit:latest"
|
2021-08-13 16:20:40 +01:00
|
|
|
|
2022-02-15 10:17:32 +00:00
|
|
|
docker:tags:gitlab:
|
|
|
|
extends: .docker-shared-settings
|
|
|
|
rules:
|
|
|
|
- if: "$CI_COMMIT_TAG"
|
|
|
|
variables:
|
|
|
|
TAG: "$CI_REGISTRY_IMAGE/matrix-conduit:$CI_COMMIT_TAG"
|
|
|
|
|
|
|
|
docker:tags:dockerhub:
|
|
|
|
extends: .docker-shared-settings
|
|
|
|
rules:
|
|
|
|
- if: "$CI_COMMIT_TAG && $DOCKER_HUB"
|
|
|
|
variables:
|
|
|
|
TAG: "$DOCKER_HUB_IMAGE/matrixconduit/matrix-conduit:$CI_COMMIT_TAG"
|
|
|
|
|
2021-08-13 16:20:40 +01:00
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
# Run tests #
|
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
|
2022-02-18 21:29:55 +00:00
|
|
|
.test-shared-settings:
|
2021-08-13 16:20:40 +01:00
|
|
|
stage: "test"
|
2021-11-21 17:34:08 +00:00
|
|
|
needs: []
|
2022-02-01 23:51:38 +00:00
|
|
|
image: "registry.gitlab.com/jfowl/conduit-containers/rust-with-tools:latest"
|
2021-11-21 17:34:08 +00:00
|
|
|
tags: ["docker"]
|
2021-08-13 16:20:40 +01:00
|
|
|
variables:
|
2021-12-14 10:16:02 +00:00
|
|
|
CARGO_INCREMENTAL: "false" # https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
|
2021-08-13 16:20:40 +01:00
|
|
|
interruptible: true
|
2022-02-18 21:29:55 +00:00
|
|
|
|
|
|
|
test:cargo:
|
|
|
|
extends: .test-shared-settings
|
2021-08-13 16:20:40 +01:00
|
|
|
before_script:
|
2022-02-18 21:29:55 +00:00
|
|
|
- rustup component add clippy
|
2021-12-14 10:16:02 +00:00
|
|
|
# If provided, bring in caching through sccache, which uses an external S3 endpoint to store compilation results:
|
2022-02-01 23:51:38 +00:00
|
|
|
- if [ -n "${SCCACHE_ENDPOINT}" ]; then export RUSTC_WRAPPER=/usr/local/cargo/bin/sccache; fi
|
2021-08-13 16:20:40 +01:00
|
|
|
script:
|
2021-11-21 17:34:08 +00:00
|
|
|
- rustc --version && cargo --version # Print version info for debugging
|
2022-02-01 23:51:38 +00:00
|
|
|
- "cargo test --color always --workspace --verbose --locked --no-fail-fast -- -Z unstable-options --format json | gitlab-report -p test > $CI_PROJECT_DIR/report.xml"
|
|
|
|
- "cargo clippy --color always --verbose --message-format=json | gitlab-report -p clippy > $CI_PROJECT_DIR/gl-code-quality-report.json"
|
2021-11-21 17:34:08 +00:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
reports:
|
|
|
|
junit: report.xml
|
|
|
|
codequality: gl-code-quality-report.json
|
2021-08-13 16:20:40 +01:00
|
|
|
|
2022-02-18 21:29:55 +00:00
|
|
|
test:format:
|
|
|
|
extends: .test-shared-settings
|
|
|
|
before_script:
|
|
|
|
- rustup component add rustfmt
|
|
|
|
script:
|
|
|
|
- cargo fmt --all -- --check
|
|
|
|
|
2022-02-18 21:30:02 +00:00
|
|
|
test:audit:
|
|
|
|
extends: .test-shared-settings
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- cargo audit --color always || true
|
|
|
|
- cargo audit --stale --json | gitlab-report -p audit > gl-sast-report.json
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
reports:
|
|
|
|
sast: gl-sast-report.json
|
|
|
|
|
2021-08-13 16:20:40 +01:00
|
|
|
test:sytest:
|
|
|
|
stage: "test"
|
|
|
|
allow_failure: true
|
|
|
|
needs:
|
|
|
|
- "build:debug:cargo:x86_64-unknown-linux-musl"
|
|
|
|
image:
|
|
|
|
name: "valkum/sytest-conduit:latest"
|
2021-11-21 17:34:08 +00:00
|
|
|
entrypoint: [""]
|
|
|
|
tags: ["docker"]
|
2021-08-13 16:20:40 +01:00
|
|
|
variables:
|
|
|
|
PLUGINS: "https://github.com/valkum/sytest_conduit/archive/master.tar.gz"
|
2022-02-15 17:33:20 +00:00
|
|
|
interruptible: true
|
2021-08-13 16:20:40 +01:00
|
|
|
before_script:
|
|
|
|
- "mkdir -p /app"
|
|
|
|
- "cp ./conduit-debug-x86_64-unknown-linux-musl /app/conduit"
|
|
|
|
- "chmod +x /app/conduit"
|
|
|
|
- "rm -rf /src && ln -s $CI_PROJECT_DIR/ /src"
|
|
|
|
- "mkdir -p /work/server-0/database/ && mkdir -p /work/server-1/database/ && mkdir -p /work/server-2/database/"
|
|
|
|
- "cd /"
|
|
|
|
script:
|
|
|
|
- "SYTEST_EXIT_CODE=0"
|
|
|
|
- "/bootstrap.sh conduit || SYTEST_EXIT_CODE=1"
|
2021-11-21 17:34:08 +00:00
|
|
|
- 'perl /sytest/tap-to-junit-xml.pl --puretap --input /logs/results.tap --output $CI_PROJECT_DIR/sytest.xml "Sytest" && cp /logs/results.tap $CI_PROJECT_DIR/results.tap'
|
2021-08-13 16:20:40 +01:00
|
|
|
- "exit $SYTEST_EXIT_CODE"
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "$CI_PROJECT_DIR/sytest.xml"
|
|
|
|
- "$CI_PROJECT_DIR/results.tap"
|
|
|
|
reports:
|
|
|
|
junit: "$CI_PROJECT_DIR/sytest.xml"
|
|
|
|
|
2022-02-15 17:33:20 +00:00
|
|
|
test:dockerlint:
|
|
|
|
stage: "test"
|
|
|
|
needs: []
|
|
|
|
image: "ghcr.io/hadolint/hadolint:latest-alpine"
|
|
|
|
interruptible: true
|
|
|
|
script:
|
|
|
|
# First pass: Print for CI log:
|
|
|
|
- >
|
|
|
|
hadolint
|
|
|
|
--no-fail --verbose
|
|
|
|
./Dockerfile
|
|
|
|
./docker/ci-binaries-packaging.Dockerfile
|
|
|
|
# Then output the results into a json for GitLab to pretty-print this in the MR:
|
|
|
|
- >
|
|
|
|
hadolint
|
|
|
|
--format gitlab_codeclimate
|
|
|
|
--failure-threshold error
|
|
|
|
./Dockerfile
|
|
|
|
./docker/ci-binaries-packaging.Dockerfile > dockerlint.json
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
reports:
|
|
|
|
codequality: dockerlint.json
|
|
|
|
paths:
|
|
|
|
- dockerlint.json
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_REF_NAME != "master"'
|
|
|
|
changes:
|
|
|
|
- docker/*Dockerfile
|
|
|
|
- Dockerfile
|
|
|
|
- .gitlab-ci.yml
|
|
|
|
- if: '$CI_COMMIT_REF_NAME == "master"'
|
|
|
|
- if: '$CI_COMMIT_REF_NAME == "next"'
|
|
|
|
|
2021-07-02 13:26:26 +01:00
|
|
|
# --------------------------------------------------------------------- #
|
2021-07-11 12:43:48 +01:00
|
|
|
# Store binaries as package so they have download urls #
|
2021-07-02 13:26:26 +01:00
|
|
|
# --------------------------------------------------------------------- #
|
2021-06-01 01:58:50 +01:00
|
|
|
|
|
|
|
publish:package:
|
2021-07-11 12:43:48 +01:00
|
|
|
stage: "upload artifacts"
|
2021-07-02 13:26:26 +01:00
|
|
|
needs:
|
2021-08-13 16:20:40 +01:00
|
|
|
- "build:release:cargo:x86_64-unknown-linux-musl"
|
2021-11-21 17:34:08 +00:00
|
|
|
- "build:release:cargo:arm-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:armv7-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:aarch64-unknown-linux-musl"
|
|
|
|
# - "build:cargo-deb:x86_64-unknown-linux-gnu"
|
2021-07-02 13:26:26 +01:00
|
|
|
rules:
|
2021-09-02 16:17:51 +01:00
|
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "next"'
|
2021-11-21 17:34:08 +00:00
|
|
|
- if: "$CI_COMMIT_TAG"
|
2021-06-01 01:58:50 +01:00
|
|
|
image: curlimages/curl:latest
|
2021-07-12 20:58:35 +01:00
|
|
|
tags: ["docker"]
|
2021-07-02 13:26:26 +01:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: "none" # Don't need a clean copy of the code, we just operate on artifacts
|
2021-06-01 01:58:50 +01:00
|
|
|
script:
|
2021-07-02 13:26:26 +01:00
|
|
|
- 'BASE_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/conduit-${CI_COMMIT_REF_SLUG}/build-${CI_PIPELINE_ID}"'
|
2021-07-19 11:00:44 +01:00
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-x86_64-unknown-linux-musl "${BASE_URL}/conduit-x86_64-unknown-linux-musl"'
|
2021-11-21 17:34:08 +00:00
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-arm-unknown-linux-musleabihf "${BASE_URL}/conduit-arm-unknown-linux-musleabihf"'
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-armv7-unknown-linux-musleabihf "${BASE_URL}/conduit-armv7-unknown-linux-musleabihf"'
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-aarch64-unknown-linux-musl "${BASE_URL}/conduit-aarch64-unknown-linux-musl"'
|
2021-07-30 14:29:45 +01:00
|
|
|
|
2021-11-21 17:34:08 +00:00
|
|
|
# Avoid duplicate pipelines
|
|
|
|
# See: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
|
|
|
|
workflow:
|
|
|
|
rules:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
|
|
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
|
|
|
|
when: never
|
|
|
|
- if: "$CI_COMMIT_BRANCH"
|
2022-02-15 10:17:46 +00:00
|
|
|
- if: "$CI_COMMIT_TAG"
|