Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Setup cachix #375

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ./dev#cachix-push
46 changes: 28 additions & 18 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