Skip to main content
Deno 2 is finally here 🎉️
Learn more

Rust Pipeline

deno module deno compatibility

A ready-to-use GitLab CI Pipeline and Jobs for your Rust projects.

🚀 Usage

Quick start:

import { GitLab } from "https://deno.land/x/rust_pipeline/mod.ts";

const { pipeline } = GitLab;

pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml

Or, if you want to use the predefined jobs:

import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci/mod.ts";
import { GitLab } from "https://deno.land/x/rust_pipeline/mod.ts";

const { build, test } = GitLab;

const const pipeline = new GitlabCI()
  .image("rust:latest")
  .addJob("test", test)
  .addJob("build", build);

pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml

It will generate the following .gitlab-ci.yml file:

# Do not edit this file directly. It is generated by Fluent GitLab CI

image: rust:latest

test:
  script:
    - cargo test

build:
  script:
    - cargo build --release

🧪 Advanced Usage

This package also provides a ready-to-use pipeline for Dagger:

import Client, { connect } from "@dagger.io/dagger";
import { Dagger } from "https://deno.land/x/rust_pipeline/mod.ts";

const { build, test } = Dagger;

function pipeline(src = ".") {
  connect(async (client: Client) => {
    await test(client, src);
    await build(client, src);
  });
}

pipeline();