Merge pull request #1065 from influxdata/cn/here-we-go-round-again

chore: Move regular CI to CircleCI
pull/24376/head
kodiakhq[bot] 2021-03-31 14:04:46 +00:00 committed by GitHub
commit f77164c9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 83 additions and 7 deletions

View File

@ -13,7 +13,13 @@
# cargo target and pushes a container with the binary to
# `quay.io/influxdb/fusion` (see perf_image below).
#
# CI for all other branches is performed by the GitHub actions (see .github dir)
# CI for all other branches:
#
# - cargo build with the default cargo profile ("dev")
# - cargo test
# - cargo fmt
# - clippy (with warnings denied)
# - lint protobufs
version: 2.1
@ -27,36 +33,71 @@ commands:
- run:
name: Install rustfmt and clippy for nightly-2020-11-19
command: rustup component add rustfmt clippy --toolchain nightly-2020-11-19
cache_restore:
description: Restore Cargo Cache
steps:
- restore_cache:
name: Restoring Cargo Cache
keys:
- cargo-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Cargo.lock" }}
- cargo-cache-{{ arch }}-{{ .Branch }}
- cargo-cache
cache_save:
description: Save Cargo Cache
steps:
- save_cache:
name: Save Cargo Cache
paths:
- /usr/local/cargo/registry
key: cargo-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Cargo.lock" }}
jobs:
fmt:
docker:
- image: quay.io/influxdb/rust:ci
environment:
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- checkout
- rust_nightly
- cache_restore
- run:
name: Rust fmt
command: cargo fmt --all -- --check
- cache_save
lint:
docker:
- image: quay.io/influxdb/rust:ci
environment:
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- checkout
- rust_nightly
- cache_restore
- run:
name: Clippy
command: cargo clippy --all-targets --workspace -- -D warnings
- cache_save
test:
docker:
- image: quay.io/influxdb/rust:ci
resource_class: xlarge # use of a smaller executor tends crashes on link
environment:
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- checkout
- rust_nightly
- cache_restore
- run:
name: Cargo test
command: cargo test --workspace
- cache_save
# Build a dev binary.
#
@ -65,12 +106,32 @@ jobs:
build:
docker:
- image: quay.io/influxdb/rust:ci
resource_class: xlarge # use of a smaller executor tends crashes on link
environment:
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- checkout
- rust_nightly
- cache_restore
- run:
name: Cargo build
command: cargo build --workspace
- run:
name: Build benches
command: cargo test --workspace --benches --no-run
- cache_save
# Lint protobufs.
protobuf-lint:
docker:
- image: bufbuild/buf:0.40.0
steps:
- checkout
- run:
name: buf lint
command: buf lint
# Compile a cargo "release" profile binary for branches that end in `/perf`
#
@ -90,9 +151,14 @@ jobs:
perf_image:
docker:
- image: quay.io/influxdb/rust:ci
environment:
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- checkout
- rust_nightly
- cache_restore
- run:
name: Cargo release build with target arch set for CRoaring
command: ROARING_ARCH=x86-64 cargo build --release
@ -111,6 +177,7 @@ jobs:
- run:
name: Deploy tags
command: ./.circleci/get-deploy-tags.sh "${BRANCH}"
- cache_save
# Prepare the CI image used for other tasks.
#
@ -135,7 +202,16 @@ jobs:
workflows:
version: 2
# Internal pipeline for perf builds.
# CI for all pull requests.
ci:
jobs:
- fmt
- lint
- protobuf-lint
- test
- build
# Internal pipeline for perf builds.
#
# Filter ensures this only runs for git branches ending in `/perf`.
perf_build: