aboutsummaryrefslogtreecommitdiff
path: root/releng/release-tests.sh
blob: c0a9b2e337bae715dd39e16201673675e8645d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash

set -euo pipefail
shopt -s inherit_errexit failglob

nixpkgss=(
    "$(nix eval --impure --raw --expr '(import ./flake.nix).inputs.nixpkgs.url')"
    "github:NixOS/nixpkgs/nixos-unstable-small"
)
jobs=(
    $(nix eval \
        --json --apply '
          let f = n: t:
            if builtins.isAttrs t
            then (if t.type or "" == "derivation"
                  then [ n ]
                  else builtins.concatMap (m: f "${n}.${m}" t.${m}) (builtins.attrNames t))
            else [];
          in f ".#.releaseTests"
        ' \
        '.#.releaseTests' \
        | jq -r '.[]'
    )
)

for override in "${nixpkgss}"
do
    (
        set -x
        nix build \
            --log-format multiline \
            --no-link \
            --override-input nixpkgs "$override" \
            "${jobs[@]}"
    )
done