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

Go Pipeline

deno module deno compatibility

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

🚀 Usage

Quick start:

import { GitLab } from "https://deno.land/x/go_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/go_pipeline/mod.ts";

const { build, test, fmt } = GitLab;

const const pipeline = new GitlabCI()
  .image("golang:latest")
  .addJob("fmt", fmt)
  .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: golang:latest

fmt:
  script:
    - go fmt ./...

test:
  script:
    - go test -v ./...

build:
  script:
    - go build

🧪 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/go_pipeline/mod.ts";

const { build, test, fmt } = Dagger;

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

pipeline();