leo/.circleci/config.yml

116 lines
3.3 KiB
YAML
Raw Normal View History

2021-02-25 07:03:50 +03:00
version: 2.1
commands:
setup_environment:
2021-02-25 07:20:02 +03:00
description: "Setup environment"
2021-02-25 07:03:50 +03:00
parameters:
cache_key:
type: string
default: leo-stable-cache
steps:
- run: set -e
- setup_remote_docker
- run:
name: Prepare environment and install dependencies
command: |
export SCCACHE_CACHE_SIZE=200M
export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin"
wget https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
mv $CIRCLE_WORKING_DIRECTORY/.bin/sccache-0.2.13-x86_64-unknown-linux-musl/sccache $CIRCLE_WORKING_DIRECTORY/.bin/sccache
export PATH="$PATH:$CIRCLE_WORKING_DIRECTORY/.bin"
export RUSTC_WRAPPER="sccache"
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
sudo apt-get update && sudo apt-get install -y clang llvm-dev llvm pkg-config xz-utils make libssl-dev libssl-dev
- restore_cache:
keys:
- << parameters.cache_key >>
clear_environment:
description: "Clear environment"
parameters:
cache_key:
type: string
default: leo-stable-cache
steps:
- run: (sccache -s||true)
- run: set +e
- save_cache:
key: << parameters.cache_key >>
paths:
- .cache/sccache
- .cargo
jobs:
2021-02-25 07:11:23 +03:00
2021-02-25 07:03:50 +03:00
rust-stable:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- checkout
- setup_environment:
cache_key: leo-stable-cache
- run:
name: Build and run tests
no_output_timeout: 30m
2021-02-25 07:37:59 +03:00
command: cargo install --path . --root .
2021-02-25 07:03:50 +03:00
- persist_to_workspace:
2021-02-25 07:55:29 +03:00
root: ~/
2021-02-25 07:03:50 +03:00
paths: project/
- clear_environment:
cache_key: leo-stable-cache
2021-02-25 07:11:23 +03:00
2021-02-25 07:03:50 +03:00
leo-new:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo new
2021-02-25 08:11:31 +03:00
command: |
2021-02-25 08:32:57 +03:00
export LEO=/home/circleci/project/project/bin/leo
2021-02-25 08:23:47 +03:00
./project/.circleci/leo-new.sh
leo-init:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
2021-02-25 08:45:06 +03:00
name: leo init
2021-02-25 08:23:47 +03:00
command: |
2021-02-25 08:32:57 +03:00
export LEO=/home/circleci/project/project/bin/leo
2021-02-25 08:23:47 +03:00
./project/.circleci/leo-init.sh
2021-02-25 07:03:50 +03:00
2021-02-25 08:45:06 +03:00
leo-clean:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo clean
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clean.sh
2021-02-25 07:03:50 +03:00
workflows:
version: 2
main-workflow:
jobs:
- rust-stable
- leo-new:
requires:
- rust-stable
2021-02-25 08:23:47 +03:00
- leo-init:
requires:
- rust-stable
2021-02-25 08:45:06 +03:00
- leo-clean:
requires:
- rust-stable