mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-24 01:18:05 +00:00
add failing test
This commit is contained in:
parent
dad23f2092
commit
d953a4ee09
3 changed files with 25 additions and 3 deletions
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
|
@ -52,3 +52,21 @@ jobs:
|
||||||
nix_path: nixpkgs=channel:nixos-20.03
|
nix_path: nixpkgs=channel:nixos-20.03
|
||||||
- run: test $NIX_PATH == "nixpkgs=channel:nixos-20.03"
|
- run: test $NIX_PATH == "nixpkgs=channel:nixos-20.03"
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
|
extra-nix-config:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: yarn install --frozen-lockfile
|
||||||
|
- run: yarn build
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
hello = world
|
||||||
|
# sandbox = relaxed
|
||||||
|
- run: cat /etc/nix/nix.conf
|
||||||
|
- run: nix-build test.nix --arg noChroot true
|
||||||
|
|
|
@ -5,8 +5,9 @@ set -euo pipefail
|
||||||
sudo sh -c 'echo max-jobs = auto >> /tmp/nix.conf'
|
sudo sh -c 'echo max-jobs = auto >> /tmp/nix.conf'
|
||||||
# Allow binary caches for runner user
|
# Allow binary caches for runner user
|
||||||
sudo sh -c 'echo trusted-users = root runner >> /tmp/nix.conf'
|
sudo sh -c 'echo trusted-users = root runner >> /tmp/nix.conf'
|
||||||
|
# Append extra nix configuration if provided
|
||||||
if [[ -n $INPUT_EXTRA_NIX_CONFIG ]]; then
|
if [[ -n $INPUT_EXTRA_NIX_CONFIG ]]; then
|
||||||
echo "$INPUT_EXTRA_NIX_CONFIG" >> /tmp/nix.conf
|
echo "$INPUT_EXTRA_NIX_CONFIG" | sudo tee -a /tmp/nix.conf >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_options=(
|
install_options=(
|
||||||
|
|
5
test.nix
5
test.nix
|
@ -2,12 +2,15 @@
|
||||||
{ size ? 1 # MB
|
{ size ? 1 # MB
|
||||||
, num ? 10 # count
|
, num ? 10 # count
|
||||||
, currentTime ? builtins.currentTime
|
, currentTime ? builtins.currentTime
|
||||||
|
, noChroot ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
let
|
let
|
||||||
drv = i: runCommand "${toString currentTime}-${toString i}" {} ''
|
drv = i: runCommand "${toString currentTime}-${toString i}" {
|
||||||
|
__noChroot = noChroot;
|
||||||
|
} ''
|
||||||
dd if=/dev/zero of=$out bs=${toString size}MB count=1
|
dd if=/dev/zero of=$out bs=${toString size}MB count=1
|
||||||
'';
|
'';
|
||||||
in writeText "empty-${toString num}-${toString size}MB" ''
|
in writeText "empty-${toString num}-${toString size}MB" ''
|
||||||
|
|
Loading…
Reference in a new issue