Skip to content

Commit

Permalink
Merge pull request #138 from gytis-ivaskevicius/update-ci
Browse files Browse the repository at this point in the history
ci: update and speed up CI
  • Loading branch information
gytis-ivaskevicius authored Oct 2, 2023
2 parents 1577ffa + 339d913 commit f9d088f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
name: CI

on:
push:
workflow_dispatch:
pull_request:
types: [opened]

jobs:
tests:
eval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
install_url: https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.8.0pre20220311_d532269/install
- uses: nixbuild/nix-quick-install-action@v25
- uses: DeterminateSystems/magic-nix-cache-action@main

# Quick eval
- run: nix develop --command evalnix
# Check formatting
- run: nix develop --command fmt --check

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nixbuild/nix-quick-install-action@v25
- uses: DeterminateSystems/magic-nix-cache-action@main

# Execute /tests/*
- run: nix develop --command check-derivation-outputs
- run: nix develop --command check-channel-patching
- run: nix develop --command check-overlays-flow
- run: nix develop --command check-hosts-config

build-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nixbuild/nix-quick-install-action@v25
- uses: DeterminateSystems/magic-nix-cache-action@main

# Build /examples/*
- run: nix develop --command build-home-manager+nur+neovim-Rick
- run: nix develop --command build-minimal-multichannel-Hostname1
- run: nix develop --command build-minimal-multichannel-Hostname2
- run: nix develop --command build-exporters-Morty
- run: nix develop --command build-darwin

# Check formatting
- run: nix develop --command fmt --check
2 changes: 1 addition & 1 deletion examples/darwin/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "A highly awesome system configuration.";

inputs = {
nixpkgs.url = github:nixos/nixpkgs/release-21.05;
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable-small;
utils.url = path:../../;
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
Expand Down
2 changes: 1 addition & 1 deletion examples/exporters/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "FUP exporters demo";

inputs = {
nixpkgs.url = github:nixos/nixpkgs/release-21.05;
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable-small; # Lets pretend that this is a stable channel
unstable.url = github:nixos/nixpkgs/nixos-unstable-small;
utils.url = path:../../;
};
Expand Down
2 changes: 1 addition & 1 deletion examples/home-manager+nur+neovim/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
};

home-manager = {
url = github:nix-community/home-manager/release-21.05;
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
};
Expand Down
4 changes: 2 additions & 2 deletions examples/minimal-multichannel/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
description = "A highly awesome system configuration.";

inputs = {
nixpkgs.url = github:nixos/nixpkgs/release-21.05;
unstable.url = github:nixos/nixpkgs/nixos-unstable;
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable-small; # Lets pretend that this is a stable channel
unstable.url = github:nixos/nixpkgs/nixos-unstable-small;
utils.url = path:../../;
};

Expand Down
8 changes: 4 additions & 4 deletions lib/mkFlake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ mergeAny otherArguments (
{ inherit pkgs; }
// (foldl' mkOutputs { } (attrNames systemOutputs))
)
# produces attrset in the shape of
# { nixosConfigurations = {}; darwinConfigurations = {}; ... }
# according to profile.output or the default `nixosConfigurations`
// foldl' mergeAny { } (attrValues (mapAttrs configurationBuilder hosts))
# produces attrset in the shape of
# { nixosConfigurations = {}; darwinConfigurations = {}; ... }
# according to profile.output or the default `nixosConfigurations`
// foldl' mergeAny { } (attrValues (mapAttrs configurationBuilder hosts))
)

0 comments on commit f9d088f

Please sign in to comment.