Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nix-community/nix-github-actions
A library to turn Nix Flake attribute sets into Github Actions matrices [maintainer=@adisbladis]
https://github.com/nix-community/nix-github-actions
Last synced: 5 days ago
JSON representation
A library to turn Nix Flake attribute sets into Github Actions matrices [maintainer=@adisbladis]
- Host: GitHub
- URL: https://github.com/nix-community/nix-github-actions
- Owner: nix-community
- License: mit
- Created: 2023-07-08T03:23:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-18T17:55:14.000Z (about 2 months ago)
- Last Synced: 2024-12-30T19:19:15.849Z (6 days ago)
- Language: Nix
- Homepage:
- Size: 18.6 KB
- Stars: 96
- Watchers: 3
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - nix-community/nix-github-actions - A library to turn Nix Flake attribute sets into Github Actions matrices [maintainer=@adisbladis] (Nix)
- awesome-starred - nix-community/nix-github-actions - A library to turn Nix Flake attribute sets into Github Actions matrices [maintainer=@adisbladis] (Nix)
README
# nix-github-actions
This is a library to turn Nix Flake attribute sets into Github Actions matrices.**Features:**
- Unopinionated
Install Nix using any method you like
- Flexible
Nix-github-actions is not an action in itself but a series of templates and a Nix library to build your own CI.
- Parallel job execution
Use one Github Actions runner per package attribute
## Usage
### Quickstart
nix-github-actions comes with a quickstart script that interactively guides you through integrating it:
``` bash
$ nix run github:nix-community/nix-github-actions
```### Manual
1. Find a CI template in [./.github/workflows](./.github/workflows) and copy it to your project
2. Integrate into your project
#### Using Flake atttribute packages
- `flake.nix`
``` nix
{
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";outputs = { self, nixpkgs, nix-github-actions }: {
githubActions = nix-github-actions.lib.mkGithubMatrix { checks = self.packages; };
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}
```#### Using Flake attribute checks
- `flake.nix`
``` nix
{
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";outputs = { self, nixpkgs, nix-github-actions }: {
githubActions = nix-github-actions.lib.mkGithubMatrix { inherit (self) checks; };
checks.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
checks.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}
```#### When your Flake supports systems that GitHub Actions does not
If your Flake contains checks for platforms unsupported by Actions, e.g. `aarch64-darwin`,
you can restrict the systems for which the matrix will be generated:``` nix
githubActions = nix-github-actions.lib.mkGithubMatrix {
checks = nixpkgs.lib.getAttrs [ "x86_64-linux" "x86_64-darwin" ] self.checks;
};
```