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.
-
Get an OAuth token.
Navigate to https://github.com/settings/tokens and generate a new OAuth token. It only needs the
repo:statuspermission. -
Add the webhook.
Go to https://github.com/$YOUR_NAME/$YOUR_REPO/settings/hooks, changing
$YOUR_NAMEand$YOUR_REPOappropriately. Add a webhook with a URL of the format:http://$PUBLIC_HOST:8080/github/web-hook, where$PUBLIC_HOSTis the publically accessible host of the server that will be running your builds.Set:
- Content type:
application/json - Secret: (anything you want)
- Which events: at least "pull request", but you can also just use "everything".
- Content type:
-
Configure the server.
In the directory you plan to run
micro-cifrom, you'll need aconfig.dhallfile. A template is:{ repoRoot = "repositories", secret = ..., oauth = ... }Fill in
oauthandsecretaccording to values previously retrieved/entered. -
Run the server.
On the machine that will run the builds, run
nix-build ci.nix -A micro-ci ./result/bin/micro-ci -
Add a
ci.nixfile to your project.Finally, write a
ci.nixfile in your project. This Nix expression should evaluate to an attribute-set of derivations.For example, a Haskell project could use:
with (import <nixpkgs> {}); { cabal-build = haskellPackages.callPackage ./default.nix {}; }
But you can be as clever as you want. All that
micro-cicares about is if the derivation can be evaluated. -
Optional: Add status checks
Open a pull request to check that everything works. If it looks good, you can enforce
micro-cito pass all jobs. Head to https://github.com/$YOUR_NAME/$YOUR_REPO/settings/branches and set up a protected branch and add theci.nixstatuses.
