Skip to main content
The Deno 2 Release Candidate is 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, just run the following command on your Rust project:

dagger run deno run -A https://deno.land/x/rust_pipeline/ci.ts

Or, if you want to use the predefined jobs:

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();