/nix-github-actions

An example project showing how to use Nix to replace third-party GitHub Actions

Primary LanguageNixMozilla Public License 2.0MPL-2.0

Nix + GitHub Actions

Note: this repo is discussed in Streamline your GitHub Actions dependencies using Nix on the Determinate Systems blog.

This repo houses an example project that shows you how to use Nix to replace (some) third-party Actions in your GitHub Actions CI pipelines. The build artifact in the repo is a simple "TODOs" web server written in Rust. The CI pipeline does several things:

  • Checks the Rust formatting using rustfmt
  • Audits the Rust code using cargo-deny
  • Checks the repo's files for EditorConfig conformance
  • Spellchecks the repo's files using codespell
  • Runs the service's tests
  • Builds an executable for the service

But different from most repos, there are two separate pipelines here that accomplish the same thing:

  • no-nix.yml configures a pipeline that uses third-party Actions for all CI logic.
  • nix.yml configures a pipeline that replaces most third-party Actions with straightforward shell commands.