Skip to content

Commit

Permalink
chore!: 2024-12-31 16:59:30 +0100
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Dec 31, 2024
1 parent a23c997 commit 64ef939
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 34 deletions.
52 changes: 22 additions & 30 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,30 @@ jobs:
}}/${{
github.event.pull_request.head.sha || github.sha
}} |
jq --compact-output --raw-output '
to_entries |
map(
.key as $type |
select($type == "checks" or $type == "packages") |
.value |
to_entries |
map(
.key as $arch |
select($arch == "x86_64-linux" or $arch == "x86_64-darwin") |
.value |
to_entries |
map(
{
arch: $arch,
key: .key,
jq --raw-output '
def format_output($arch; $type):
{
arch: $arch,
key: .,
os: (
if $arch == "x86_64-linux" then
"ubuntu-24.04"
else
"macos-14"
end
),
os: (
if $arch == "x86_64-linux" then
"ubuntu-24.04"
else
"macos-14"
end
),
type: $type,
}
)
) |
flatten
) |
flatten |
type: $type
};
[
["x86_64-linux", "x86_64-darwin"][] as $arch |
(.checks[$arch] | keys) as $checks |
(.packages[$arch] | keys) as $packages |
(($checks - $packages)[] | format_output($arch; "checks")),
($packages[] | format_output($arch; "packages"))
] |
"packages=\(.)"
' >> $GITHUB_OUTPUT
Expand Down
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

src = ./.;
};
} {};
} self.packages.${system};

devShells = {
default = pkgs.mkShell {
Expand Down Expand Up @@ -157,10 +157,10 @@
text = ''
nix flake show --json --no-update-lock-file |
jq --raw-output '
((.packages."${system}" // {}) | keys) as $packages |
((.checks."${system}" // {}) | keys) as $checks |
($packages[] | "packages.${system}.\(.)"),
(($checks - $packages)[] | "checks.${system}.\(.)")
((.packages."${system}" // {}) | keys) as $packages |
(($checks - $packages)[] | "checks.${system}.\(.)"),
($packages[] | "packages.${system}.\(.)")
' |
parallel --halt now,fail=1 '
nix build --no-update-lock-file --verbose .#{}
Expand Down

0 comments on commit 64ef939

Please sign in to comment.