local build_image = 'ayllu-arch'; local cargo_target_dir = '/home/ayllu/cargo-target'; local cargo_cache = { name: 'cargo-cache', path: '/home/ayllu/.cargo/registry', }; local build_cache = { name: 'build-cache', path: cargo_target_dir, transient: true, }; local short_step(name, input) = { name: name, input: input, environment: { CARGO_TARGET_DIR: cargo_target_dir, }, }; { workflows: [ { name: 'Lint', image: build_image, steps: [ short_step('Cargo Lint', 'cargo fmt --check'), ], cache: [cargo_cache, build_cache], }, { name: 'Metadata', image: build_image, networking: true, steps: [ short_step('Fetch', 'cargo fetch --locked'), short_step('Metadata', 'cargo metadata > metadata.json'), ], cache: [cargo_cache, build_cache], outputs: [{ path: 'metadata.json', sha256sum: null, }], depends_on: ['Lint'], }, { name: 'Test', image: build_image, steps: [ short_step('Cargo Test', 'cargo test --frozen --release'), ], cache: [cargo_cache, build_cache], depends_on: ['Lint', 'Metadata'], }, ], }