use new runner

This commit is contained in:
Adam Shamblin 2022-11-22 15:16:53 -07:00
parent ae6ff1b512
commit 46cc2e121f
No known key found for this signature in database
GPG Key ID: 22E0BC8E6B4D8C8E

View File

@ -1,82 +1,17 @@
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive NO_DOCKER: 1
BUILD_IMAGE_LINUX_AMD64: $CI_REGISTRY/veilid/ci-cd/veilid-build-linux-amd64:latest FORCE_COLOR: 1
EARTHLY_EXEC_CMD: "/bin/sh"
stages:
- clippy
- test
- build
############# Clippy Lint before_script:
- earthly bootstrap
clippy: earthly:
stage: clippy
image: ${BUILD_IMAGE_LINUX_AMD64}
cache:
key: $CI_COMMIT_REF_SLUG-linux-amd64
paths:
- target/
tags:
- linux
- amd64
script:
- cargo clippy
# Only run clippy on non-protected branches, for development
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_MERGE_REQUEST_IID
when: never
- if: $CI_COMMIT_REF_PROTECTED == "false"
############# Unit Testing
.test_rules_common:
# Only do tests for tags, protected branches, or merge requests
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_REF_PROTECTED == "true"
test_linux_amd64:
stage: test
image: ${BUILD_IMAGE_LINUX_AMD64}
cache:
key: $CI_COMMIT_REF_SLUG-linux-amd64
paths:
- target/
tags:
- linux
- amd64
script:
- RUST_BACKTRACE=1 dbus-run-session -- cargo test -- --nocapture
rules:
- !reference [.test_rules_common, rules]
############# Build
.build_rules_common:
# Only build for tags or protected branches
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_REF_PROTECTED == "true"
build_linux_amd64:
stage: build stage: build
image: ${BUILD_IMAGE_LINUX_AMD64} image: earthly/earthly:v0.6.30
cache:
key: $CI_COMMIT_REF_SLUG-linux-amd64
paths:
- target/
tags: tags:
- linux - linux
- amd64 - amd64
script: script:
- cargo build --release - earthly --ci -P +package-linux
artifacts:
name: $CI_COMMIT_REF_SLUG-linux-amd64
paths:
- target/release/veilid-cli
- target/release/veilid-server
rules:
- !reference [.build_rules_common, rules]