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

test #43

Closed
wants to merge 39 commits into from
Closed

test #43

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1cf5257
upgrade nixpkgs fork
Mic92 Jul 17, 2021
34e588e
home-assistant: disable checks
Mic92 Jul 22, 2021
d8ab595
nixos/udev: no replacement warnings when patching rules
Mic92 Sep 2, 2021
81d1322
switch-to-configuration: skip systemd setup
Mic92 Oct 20, 2021
280e341
alertmanager: disable cluster listen-address
Mic92 Nov 26, 2021
cb66e75
nixos/homeassistant: support for python_script automation
Mic92 Feb 16, 2022
45a5001
dendrite: apply systemd hardening
Mic92 May 15, 2022
443814d
allow unfree packages by default
Mic92 Sep 7, 2022
6040421
nixos/buildbot: no longer use /home for build user
Mic92 Oct 8, 2022
16b515d
hass: add option to link custom components
Mic92 Oct 10, 2022
3cee1a4
wcc: 2018-04-05 -> 2022-11-06
Mic92 Dec 1, 2022
411722a
nixos/borgbackup: fix env vars not being passed verbatim in job wrappers
erikarvstedt Jul 2, 2022
b9cce46
python3.pkgs.cli-formatter: init at 1.2.0
symphorien Dec 23, 2022
ad67a3f
doc/nixos/tests: make shell_interact example reconnect forever
Mic92 Feb 1, 2023
7764368
nixos/google-oslogin: start after network target
Mic92 Mar 4, 2023
65d1ef3
nixos/install-grub: use more modern make_path
Mic92 Mar 27, 2023
4032925
nixos/install-grub: don't use bare file handles and 3 argument open
Mic92 Mar 27, 2023
2039d1c
add license helper
Mic92 Oct 19, 2023
3a68ab7
gitea: add zstd patch
Mic92 Jan 24, 2024
fe4acc0
sysdig: fix build
Mic92 Feb 6, 2024
54cbce5
grub: add serial option
Mic92 Mar 21, 2024
67b8074
amazon: make fileSystems option disko-compatible
Mic92 Mar 22, 2024
6a557f3
weechat-signald: init at 2024-04-21
Mic92 Jun 15, 2024
06c112a
ubootPinecube: init
Mic92 Jul 19, 2024
1a07042
better unique
Mic92 Aug 24, 2024
14e2a48
Revert "better unique"
Mic92 Aug 24, 2024
5be2a34
libolm: remove knownVulnerabilities
Mic92 Sep 2, 2024
f47548f
nixos/userborn: explictly check that stage1 systemd is enabled
Mic92 Oct 4, 2024
dace83d
Revert "matrix-sliding-sync: drop"
Mic92 Oct 30, 2024
429feea
zfsUnstable: 2.3.0-rc2 -> 2.3.0-rc3
Mic92 Nov 9, 2024
85c5f43
add github action to build packages
Mic92 Nov 20, 2024
754c82c
use shallow clones to download github
Mic92 Nov 21, 2024
02d1a36
ci/eval: cancel previous run if new code is pushed
Mic92 Nov 21, 2024
1141f4e
ci/eval: test aliases
Mic92 Nov 29, 2024
ce104a6
github/workflows/eval: add markdown of added, removed and changed
itepastra Nov 30, 2024
3b662f8
github/workflows/eval: limit number of packages in markdown
Mic92 Dec 1, 2024
b6b7979
etc-overlay: mount the metadata image read-only
r-vdp Nov 30, 2024
90a634c
wip
Mic92 Dec 1, 2024
0df3cd6
test
Mic92 Dec 1, 2024
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
73 changes: 73 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Build packages"
on:
workflow_dispatch:
inputs:
packages:
description: "Comma-separated attributes to build"
type: string
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out the PR at the test merge commit
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Nix
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30

- name: Build package
run: |
nix build -L --impure --expr '{ packages }:
let
pkgs = import ./. {
config = {
allowUnfree = true;
allowInsecurePredicate = x: true;
allowAliases = false;
};
};
lib = pkgs.lib;
packageList = lib.strings.splitString "," packages;
packageAttrs = map (package: lib.splitString "." package) packageList;
pkgsAndTests = map (packageAttr:
let
pkg = lib.attrByPath packageAttr null pkgs;
tests = lib.attrByPath (packageAttr ++ ["tests"]) null pkgs;
evalResult = builtins.tryEval "${pkg}";
in if evalResult.success then [ pkg tests ] else []
) packageAttrs;
in pkgsAndTests' --argstr packages '${{ inputs.packages }}'

- name: Post build status comment if part of a pull request
uses: actions/github-script@4020e461acd7a80762cdfff123a1fde368246fa4
with:
script: |
const { context, github } = require('@actions/github');
const branch = context.ref.replace('refs/heads/', '');
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
head: `${context.repo.owner}:${branch}`
});
const pr = pulls.length > 0 ? pulls[0] : null;
if (pr) {
const status = context.payload.workflow_run.conclusion;
const run_id = context.runId;
const repo = context.repo.repo;
const owner = context.repo.owner;
const build_url = `https://github.com/${owner}/${repo}/actions/runs/${run_id}`;
const packages = context.payload.inputs.packages;
const os = context.runner.os;
const comment = `Build status: ${status}\nOS: ${os}\nPackages: ${packages}\n[Build logs](${build_url})`;
const issue_number = pr.number;
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: comment
});
}
26 changes: 25 additions & 1 deletion .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
- haskell-updates
- python-updates

# Cancel previous if someone pushed an update
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand Down Expand Up @@ -86,6 +91,25 @@ jobs:
name: paths
path: result/*

eval-aliases:
name: Eval nixpkgs with aliases enabled
runs-on: ubuntu-latest
needs: attrs
steps:
- name: Check out the PR at the test merge commit
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.attrs.outputs.mergedSha }}
path: nixpkgs

- name: Install Nix
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30

- name: Query nixpkgs with aliases enabled to check for basic syntax errors
id: systems
run: |
time nix-env -I ./nixpkgs -f ./nixpkgs -qa '*' --meta --option restrict-eval true --option allow-import-from-derivation false >/dev/null

outpaths:
name: Outpaths
runs-on: ubuntu-latest
Expand Down Expand Up @@ -210,7 +234,7 @@ jobs:
--arg beforeResultDir ./baseResult \
--arg afterResultDir ./prResult \
-o comparison

cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
# TODO: Request reviews from maintainers for packages whose files are modified in the PR

- name: Upload the combined results
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/rebase-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Upgrade nixpkgs fork

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '51 2 * * 0'
jobs:
rebase-branches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Git rebase
run: |
git fetch https://github.com/NixOS/nixpkgs nixos-unstable:nixos-unstable
git config --global user.email "[email protected]"
git config --global user.name "Jörg Thalheim"
git rebase nixos-unstable
git push --force origin main
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
test
<p align="center">
<a href="https://nixos.org">
<picture>
Expand Down
7 changes: 4 additions & 3 deletions ci/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ in
let
nixpkgs' =
if nixpkgs == null then
fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${pinnedNixpkgs.rev}.tar.gz";
sha256 = pinnedNixpkgs.sha256;
builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs";
rev = pinnedNixpkgs.rev;
shallow = true;
}
else
nixpkgs;
Expand Down
14 changes: 14 additions & 0 deletions ci/eval/changed-paths-markdown.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def truncate(xs; n):
if xs | length > n then xs[:n] + ["..."]
else xs
end;

def itemize_packages(xs):
truncate(xs; 3000) | map("- \(. )") | join("\n");

def section(title; xs):
"## " + title + " (" + (xs | length | tostring) + ")\n" + itemize_packages(xs)

section("Added"; .attrdiff.added) + "\n\n" +
section("Removed"; .attrdiff.removed) + "\n\n" +
section("Changed"; .attrdiff.changed)
File renamed without changes.
10 changes: 8 additions & 2 deletions ci/eval/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,18 @@ let
}
''
mkdir $out
jq -n -f ${./compare.jq} \
jq -n -f ${./compare-outpaths.jq} \
--slurpfile before ${beforeResultDir}/outpaths.json \
--slurpfile after ${afterResultDir}/outpaths.json \
> $out/changed-paths.json

# TODO: Compare eval stats
jq -n -f ${./compare-eval-stats.jq} \
--slurpfile before ${beforeResultDir}/outpaths.json \
--slurpfile after ${afterResultDir}/outpaths.json \
> $out/changed-paths.json

jq -n -f ${./changed-paths-markdown.jq} < $out/changed-paths.json > $out/step-summary.md
jq -n -f ${./eval-stats-markdown.jq} < $out/changed-paths.json >> $out/step-summary.md
'';

full =
Expand Down
1 change: 1 addition & 0 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ let
mergeAttrsByFuncDefaultsClean mergeAttrBy
fakeHash fakeSha256 fakeSha512
nixType imap;
inherit (callLibs ./halalify.nix) halalify haramify;
inherit (self.versions)
splitVersion;
});
Expand Down
5 changes: 5 additions & 0 deletions lib/halalify.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ lib }:
{
halalify = drv: drv.overrideAttrs (_old: { meta = _old.meta // { license = lib.licenses.free; }; });
haramify = drv: drv.overrideAttrs (_old: { meta = _old.meta // { license = lib.licenses.unfree; }; });
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ In the terminal where the test driver is running, connect to this server by
using:

```py
>>> machine.shell_interact("tcp:127.0.0.1:4444")
>>> machine.shell_interact("tcp:127.0.0.1:4444,forever,interval=2")
```

Once the connection is established, you can enter commands in the socat terminal
Expand Down
Loading