mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-12-29 11:11:02 +01:00
Compare commits
7 Commits
dagger-sdk
...
199fe16dbf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
199fe16dbf | ||
|
3cfd032a85
|
|||
|
83ae5b476a
|
|||
|
60dfad0aaa
|
|||
|
25fb9d4f24
|
|||
|
f42da8416a
|
|||
|
98781f2496
|
16
.github/workflows/ci.yaml
vendored
16
.github/workflows/ci.yaml
vendored
@@ -1,8 +1,13 @@
|
|||||||
name: ci
|
name: ci
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -11,5 +16,16 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Update rust toolchain
|
- name: Update rust toolchain
|
||||||
run: rustup update stable && rustup default stable
|
run: rustup update stable && rustup default stable
|
||||||
|
- name: Set up cargo cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
continue-on-error: false
|
||||||
|
with:
|
||||||
|
path: "~/.cargo/bin/\n~/.cargo/registry/index/\n~/.cargo/registry/cache/\n~/.cargo/git/db/\ntarget/ "
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-cargo-
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2.0.0
|
||||||
- name: Run dagger [CI]
|
- name: Run dagger [CI]
|
||||||
run: cargo run -p ci -- pr
|
run: cargo run -p ci -- pr
|
||||||
|
|||||||
44
Cargo.lock
generated
44
Cargo.lock
generated
@@ -114,7 +114,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"dagger-sdk 0.2.0",
|
"dagger-sdk 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"eyre",
|
"eyre",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -259,9 +259,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "02a16b0e83ae5b88a3d4e2f3cf5149932cfcb3113e67f5579372e25d5dab5b53"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"dirs",
|
"dirs",
|
||||||
@@ -284,6 +282,8 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4805375918d0605477dac436be1c4d13a46c6f3fa1383b8eb624a31688a4b99b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"dirs",
|
"dirs",
|
||||||
@@ -328,24 +328,6 @@ dependencies = [
|
|||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dagger-sdk"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e454c49b81feeb5c4057f54223cb8d7618e5d015ed835c3f3fa231fefa04e833"
|
|
||||||
dependencies = [
|
|
||||||
"base64",
|
|
||||||
"dagger-core 0.2.0",
|
|
||||||
"eyre",
|
|
||||||
"futures",
|
|
||||||
"genco",
|
|
||||||
"gql_client",
|
|
||||||
"pretty_assertions",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
@@ -363,6 +345,24 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dagger-sdk"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91342638dfdcd44ca5d3a2cc1b962e3f2c0e461487e90fe62972ef31df74c061"
|
||||||
|
dependencies = [
|
||||||
|
"base64",
|
||||||
|
"dagger-core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"eyre",
|
||||||
|
"futures",
|
||||||
|
"genco",
|
||||||
|
"gql_client",
|
||||||
|
"pretty_assertions",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "diff"
|
name = "diff"
|
||||||
version = "0.1.13"
|
version = "0.1.13"
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
dagger-sdk = "0.2.0"
|
dagger-sdk = "0.2.1"
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
|
|||||||
@@ -98,10 +98,59 @@ 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(
|
||||||
|
"AWS_ACCESS_KEY_ID".into(),
|
||||||
|
std::env::var("AWS_ACCESS_KEY_ID").unwrap_or("".into()),
|
||||||
|
)
|
||||||
|
.with_env_variable(
|
||||||
|
"AWS_SECRET_ACCESS_KEY".into(),
|
||||||
|
std::env::var("AWS_SECRET_ACCESS_KEY").unwrap_or("".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,
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ pub mod cli;
|
|||||||
mod cli_generate;
|
mod cli_generate;
|
||||||
|
|
||||||
fn main() -> eyre::Result<()> {
|
fn main() -> eyre::Result<()> {
|
||||||
// test change
|
//
|
||||||
|
|
||||||
color_eyre::install().unwrap();
|
color_eyre::install().unwrap();
|
||||||
|
|
||||||
let args = std::env::args();
|
let args = std::env::args();
|
||||||
|
|||||||
Reference in New Issue
Block a user