Skip to content

Commit 3fc7144

Browse files
committed
feat: private modifications
1 parent 53287da commit 3fc7144

File tree

4 files changed

+65
-11
lines changed

4 files changed

+65
-11
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
description: "Build on x86_64-darwin"
2525
required: true
2626
type: choice
27-
default: yes_sandbox_relaxed
27+
default: yes_sandbox_true
2828
options:
2929
- "no"
3030
- yes_sandbox_false
@@ -34,7 +34,7 @@ on:
3434
description: "Build on aarch64-darwin"
3535
required: true
3636
type: choice
37-
default: yes_sandbox_relaxed
37+
default: yes_sandbox_true
3838
options:
3939
- "no"
4040
- yes_sandbox_false

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: check
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, private]
66
pull_request:
77

88
permissions:

.github/workflows/review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
description: "Run on x86_64-darwin"
2828
required: true
2929
type: choice
30-
default: yes_sandbox_relaxed
30+
default: yes_sandbox_true
3131
options:
3232
- "no"
3333
- yes_sandbox_false
@@ -37,7 +37,7 @@ on:
3737
description: "Run on aarch64-darwin"
3838
required: true
3939
type: choice
40-
default: yes_sandbox_relaxed
40+
default: yes_sandbox_true
4141
options:
4242
- "no"
4343
- yes_sandbox_false

shortcut.js

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,76 @@
66

77
const repo = "Defelo/nixpkgs-review-gha";
88

9-
const reviewDefaults = ({ title, commits, labels, author, authoredByMe, hasLinuxRebuilds, hasDarwinRebuilds }) => {
10-
const darwinSandbox = "relaxed";
9+
const reviewDefaults = ({
10+
title,
11+
commits,
12+
labels,
13+
author,
14+
authoredByMe,
15+
hasLinuxRebuilds,
16+
hasDarwinRebuilds,
17+
state,
18+
}) => {
19+
const darwinSandboxFalseList = ["miniserve", "radicle-ci-broker"];
20+
const darwinSandboxRelaxedList = ["jujutsu", "smtp4dev"];
21+
const x8664DarwinSkipList = [];
22+
23+
const testMap = [[["radicle-ci-broker", "radicle-native-ci", "radicle-job"], "nixosTests.radicle-ci-broker"]];
24+
const testPackages = [
25+
"alertmanager-ntfy",
26+
"anubis",
27+
"chhoto-url",
28+
"echoip",
29+
"glitchtip",
30+
"go-httpbin",
31+
"olivetin",
32+
"privatebin",
33+
"radicle-node",
34+
"taplo",
35+
"uiua",
36+
"uiua-unstable",
37+
"whoami",
38+
"zipline",
39+
];
40+
41+
const skipMap = [[["taplo"], "servo"]];
42+
43+
const pkgsChanged = pkgs => pkgs.some(p => commits.some(({ subject }) => subject.startsWith(`${p}:`)));
44+
45+
const extraPkgs = new Set(
46+
testMap
47+
.filter(([pkgs]) => pkgsChanged(pkgs))
48+
.map(([, test]) => test)
49+
.concat(testPackages.filter(pkg => pkgsChanged([pkg])).map(pkg => `${pkg}.tests`)),
50+
);
51+
52+
const skipPkgs = new Set(
53+
skipMap.filter(([pkgs, skip]) => pkgsChanged(pkgs) && !pkgsChanged([skip])).map(([, skip]) => skip),
54+
);
55+
56+
const darwinSandbox = pkgsChanged(darwinSandboxFalseList)
57+
? "false"
58+
: pkgsChanged(darwinSandboxRelaxedList)
59+
? "relaxed"
60+
: true;
1161

1262
const hasRebuilds = hasLinuxRebuilds || hasDarwinRebuilds;
1363

1464
return {
15-
// "branch": "main",
65+
branch: "private",
1666
"x86_64-linux": !hasRebuilds || hasLinuxRebuilds,
1767
"aarch64-linux": !hasRebuilds || hasLinuxRebuilds,
18-
"x86_64-darwin": !hasRebuilds || hasDarwinRebuilds ? `yes_sandbox_${darwinSandbox}` : "no",
68+
"x86_64-darwin":
69+
!hasRebuilds || (hasDarwinRebuilds && !pkgsChanged(x8664DarwinSkipList)) ? `yes_sandbox_${darwinSandbox}` : "no",
1970
"aarch64-darwin": !hasRebuilds || hasDarwinRebuilds ? `yes_sandbox_${darwinSandbox}` : "no",
20-
// "extra-args": "",
71+
"extra-args": [...extraPkgs]
72+
.map(pkg => `-a ${pkg}`)
73+
.concat([...skipPkgs].map(pkg => `--skip-package ${pkg}`))
74+
.join(" "),
2175
// "push-to-cache": true,
2276
// "upterm": false,
2377
// "post-result": true,
24-
// "on-success": "nothing",
78+
"on-success": state === "DRAFT" ? "mark_as_ready" : "nothing",
2579
};
2680
};
2781

0 commit comments

Comments
 (0)