feat(ci): with sccache

This commit is contained in:
Kasper Juul Hermansen 2023-02-18 16:57:35 +01:00
parent 98781f2496
commit f42da8416a
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
2 changed files with 43 additions and 0 deletions

View File

@ -98,10 +98,51 @@ fn get_dependencies(client: Arc<Query>) -> Container {
let cache_cargo_index_dir = client.cache_volume("cargo_index".into()); let cache_cargo_index_dir = client.cache_volume("cargo_index".into());
let cache_cargo_deps = client.cache_volume("cargo_deps".into()); let cache_cargo_deps = client.cache_volume("cargo_deps".into());
let minio_url = "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into();
let base_image = client let base_image = client
.container(None) .container(None)
.from("rust:latest".into()) .from("rust:latest".into())
.with_workdir("app".into()) .with_workdir("app".into())
.with_exec(vec!["apt-get".into(), "update".into()], None)
.with_exec(
vec![
"apt-get".into(),
"install".into(),
"--yes".into(),
"libpq-dev".into(),
"wget".into(),
],
None,
)
.with_exec(vec!["wget".into(), minio_url], None)
.with_exec(
vec![
"tar".into(),
"xzf".into(),
"sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into(),
],
None,
)
.with_exec(
vec![
"mv".into(),
"sccache-v0.3.3-x86_64-unknown-linux-musl/sccache".into(),
"/usr/local/bin/sccache".into(),
],
None,
)
.with_exec(
vec!["chmod".into(), "+x".into(), "/usr/local/bin/sccache".into()],
None,
)
.with_env_variable("RUSTC_WRAPPER".into(), "/usr/local/bin/sccache".into())
.with_env_variable("SCCACHE_BUCKET".into(), "sccache".into())
.with_env_variable("SCCACHE_REGION".into(), "auto".into())
.with_env_variable(
"SCCACHE_ENDPOINT".into(),
"https://api-minio.front.kjuulh.io".into(),
)
.with_exec( .with_exec(
vec!["cargo".into(), "install".into(), "cargo-chef".into()], vec!["cargo".into(), "install".into(), "cargo-chef".into()],
None, None,

View File

@ -4,6 +4,8 @@ pub mod cli;
mod cli_generate; mod cli_generate;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
//
color_eyre::install().unwrap(); color_eyre::install().unwrap();
let args = std::env::args(); let args = std::env::args();