Skip to content

Commit

Permalink
chore(ci): Setup cachix, then push & pin
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Oct 24, 2024
1 parent 8ce7056 commit 3e3d9c9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ jobs:
strategy:
matrix:
# Intel mac excluded; See https://github.com/juspay/services-flake/issues/231
system: [ x86_64-linux, aarch64-darwin ]
system: [x86_64-linux, aarch64-darwin]
steps:
- uses: actions/checkout@v4
- uses: cachix/cachix-action@v14
with:
name: services-flake
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
- name: om ci
run: om ci --extra-access-tokens "github.com=${{ secrets.GITHUB_TOKEN }}" run --systems "${{ matrix.system }}"
# Push the Nix cache
- name: Push to cachix
# if: github.ref == 'refs/heads/main'
run: nix --option system "${{ matrix.system }}" run .#cachix-push
16 changes: 16 additions & 0 deletions dev/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion dev/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
cachix-push.url = "github:juspay/cachix-push";

# CI will override `services-flake` to run checks on the latest source
services-flake.url = "github:juspay/services-flake";
};
Expand All @@ -19,9 +21,10 @@
inputs.flake-root.flakeModule
inputs.treefmt-nix.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
inputs.cachix-push.flakeModule
./nix/pre-commit.nix
];
perSystem = { pkgs, lib, config, ... }: {
perSystem = { self', pkgs, config, ... }: {
treefmt = {
projectRoot = inputs.services-flake;
projectRootFile = "flake.nix";
Expand All @@ -32,6 +35,12 @@
nixpkgs-fmt.enable = true;
};
};
cachix-push = {
cacheName = "services-flake";
pathsToCache = {
devshell = self'.devShells.default;
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
just
Expand Down

0 comments on commit 3e3d9c9

Please sign in to comment.