haskell-servant/micro-ci

Name: micro-ci

Owner: servant

Description: A tiny CI server built around GitHub and Nix

Forked from: ocharles/micro-ci

Created: 2017-11-28 08:59:52.0

Updated: 2017-11-28 08:59:54.0

Pushed: 2017-11-28 17:49:09.0

Homepage: null

Size: 97

Language: Haskell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

micro-ci

Hello, thanks for checking out micro-ci.

micro-ci is a tiny continuous integration server, that tries to do very little. By this, we mean off loading as much logic as possible to other systems. In particular, this continuous integration server only supports GitHub and Nix.

This project is in its infancy, but if you'd like to play along at home, here's how.

Example

Getting Started
  1. Get an OAuth token.

    Navigate to https://github.com/settings/tokens and generate a new OAuth token. It only needs the repo:status permission.

  2. Add the webhook.

    Go to https://github.com/$YOUR_NAME/$YOUR_REPO/settings/hooks, changing $YOUR_NAME and $YOUR_REPO appropriately. Add a webhook with a URL of the format: http://$PUBLIC_HOST:8080/github/web-hook, where $PUBLIC_HOST is the publically accessible host of the server that will be running your builds.

    Set:

  3. Content type: application/json

  4. Secret: (anything you want)

  5. Which events: at least “pull request”, but you can also just use “everything”.

  6. Configure the server.

    In the directory you plan to run micro-ci from, you'll need a config.dhall file. A template is:

    
    poRoot = "repositories",
    cret = ...,
    uth = ...
    
    

    Fill in oauth and secret according to values previously retrieved/entered.

  7. Run the server.

    On the machine that will run the builds, run

    build ci.nix -A micro-ci
    sult/bin/micro-ci
    
  8. Add a ci.nix file to your project.

    Finally, write a ci.nix file in your project. This Nix expression should evaluate to an attribute-set of derivations.

    For example, a Haskell project could use:

     (import <nixpkgs> {});
    
    bal-build = haskellPackages.callPackage ./default.nix {};
    
    

    But you can be as clever as you want. All that micro-ci cares about is if the derivation can be evaluated.

  9. Optional: Add status checks

    Open a pull request to check that everything works. If it looks good, you can enforce micro-ci to pass all jobs. Head to https://github.com/$YOUR_NAME/$YOUR_REPO/settings/branches and set up a protected branch and add the ci.nix statuses.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.