Skip to content

Commit

Permalink
ci: add nix ci that uploads build result to cachix
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnossiom committed Dec 20, 2023
1 parent a4358d2 commit 4ee468f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Nix
on: [push, pull_request]

jobs:
build:
name: Check flake and upload build cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Authenticate with Cachix
uses: cachix/cachix-action@v13
with:
name: mrnossiom
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Check flake structure
run: nix flake check

- name: Build nix package
run: nix build --print-build-logs
12 changes: 5 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Rust CI
name: Rust
on: [push, pull_request]

jobs:
check:
name: Check, Test, Format and Clippy
name: Check and test Rust code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
Expand All @@ -28,7 +26,7 @@ jobs:
with:
command: test

- name: Format Check
- name: Cargo Format Check
uses: actions-rs/cargo@v1
with:
command: fmt
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

###### Check for unsaved or uncommitted changes on your machine.

![Nix Powered](https://img.shields.io/badge/Nix-Powered-blue?logo=nixos)
[![Cachix Cache](https://img.shields.io/badge/cachix-mrnossiom-blue.svg)](https://mrnossiom.cachix.org)

# Usage

Set the `leaveTool.defaultFolder` key in your git global configuration file to use the `--default` or `-d` flag.
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pkgs = import nixpkgs { inherit system overlays; };
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

nativeBuildInputs = with pkgs; [ rustToolchain pkg-config ];
nativeBuildInputs = with pkgs; [ rustToolchain pkg-config act ];
buildInputs = with pkgs; [ openssl ];
in
with pkgs;
Expand Down

0 comments on commit 4ee468f

Please sign in to comment.