Set cargo home in ci to avoid redownloading deps between steps (#2587)

* Set cargo home in ci to avoid redownloading deps between steps

* remove protobuf

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
Nutomic 2022-11-25 04:43:31 +00:00 committed by GitHub
parent d39bc14c43
commit 96a2bec691
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,9 +26,9 @@ steps:
# when adding new clippy lints, make sure to also add them in scripts/fix-clippy.sh # when adding new clippy lints, make sure to also add them in scripts/fix-clippy.sh
- name: cargo clippy - name: cargo clippy
image: rust:1.65-buster image: rust:1.65-buster
environment:
CARGO_HOME: .cargo
commands: commands:
- apt-get update
- apt-get -y install protobuf-compiler libprotobuf-dev
- rustup component add clippy - rustup component add clippy
- cargo clippy --workspace --tests --all-targets --all-features -- - cargo clippy --workspace --tests --all-targets --all-features --
-D warnings -D deprecated -D clippy::perf -D clippy::complexity -D warnings -D deprecated -D clippy::perf -D clippy::complexity
@ -47,6 +47,7 @@ steps:
LEMMY_CONFIG_LOCATION: ../../config/config.hjson LEMMY_CONFIG_LOCATION: ../../config/config.hjson
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1 RUST_TEST_THREADS: 1
CARGO_HOME: .cargo
commands: commands:
- apt-get update - apt-get update
- apt-get -y install --no-install-recommends postgresql-client protobuf-compiler libprotobuf-dev - apt-get -y install --no-install-recommends postgresql-client protobuf-compiler libprotobuf-dev
@ -54,12 +55,16 @@ steps:
- name: check defaults.hjson updated - name: check defaults.hjson updated
image: clux/muslrust:1.64.0 image: clux/muslrust:1.64.0
environment:
CARGO_HOME: .cargo
commands: commands:
- ./scripts/update_config_defaults.sh config/defaults_current.hjson - ./scripts/update_config_defaults.sh config/defaults_current.hjson
- diff config/defaults.hjson config/defaults_current.hjson - diff config/defaults.hjson config/defaults_current.hjson
- name: check with different features - name: check with different features
image: clux/muslrust:1.64.0 image: clux/muslrust:1.64.0
environment:
CARGO_HOME: .cargo
commands: commands:
- cargo install cargo-workspaces - cargo install cargo-workspaces
- cargo workspaces exec cargo check --no-default-features - cargo workspaces exec cargo check --no-default-features
@ -72,6 +77,8 @@ steps:
- name: cargo build - name: cargo build
image: clux/muslrust:1.64.0 image: clux/muslrust:1.64.0
environment:
CARGO_HOME: .cargo
commands: commands:
- cargo build - cargo build
- mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server