Compare commits
1 Commits
fix-97
...
resilient-
Author | SHA1 | Date | |
---|---|---|---|
783053eda6 |
27
.github/workflows/test.yml
vendored
27
.github/workflows/test.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.3.5
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -31,7 +31,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.3.5
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -47,7 +47,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.3.5
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -65,7 +65,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.3.5
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -74,6 +74,7 @@ jobs:
|
|||||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: nix flake show github:NixOS/nixpkgs
|
- run: nix flake show github:NixOS/nixpkgs
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.3.5
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -93,19 +94,3 @@ jobs:
|
|||||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
oldest-supported-installer:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.5
|
|
||||||
- run: yarn install --frozen-lockfile
|
|
||||||
- run: yarn build
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixos-21.05
|
|
||||||
install_url: https://releases.nixos.org/nix/nix-2.3.5/install
|
|
||||||
- run: nix-build test.nix
|
|
||||||
|
@ -18,7 +18,6 @@ or [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs.html)
|
|||||||
- Allows specifying extra Nix configration options via `extra_nix_config`
|
- Allows specifying extra Nix configration options via `extra_nix_config`
|
||||||
- Allows specifying `$NIX_PATH` and channels via `nix_path`
|
- Allows specifying `$NIX_PATH` and channels via `nix_path`
|
||||||
- Share `/nix/store` between builds using [cachix-action](https://github.com/cachix/cachix-action) for simple binary cache setup to speed up your builds and share binaries with your team
|
- Share `/nix/store` between builds using [cachix-action](https://github.com/cachix/cachix-action) for simple binary cache setup to speed up your builds and share binaries with your team
|
||||||
- Enables `flakes` and `nix-command` experimental features by default (to disable, set ``experimental-features` via `extra_nix_config`)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.3.4
|
||||||
- uses: cachix/install-nix-action@v14.1
|
- uses: cachix/install-nix-action@v13
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- run: nix-build
|
- run: nix-build
|
||||||
@ -53,11 +52,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.3.4
|
||||||
- uses: cachix/install-nix-action@v14.1
|
- uses: cachix/install-nix-action@v14
|
||||||
with:
|
with:
|
||||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
|
||||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: nix build
|
- run: nix build
|
||||||
- run: nix flake check
|
- run: nix flake check
|
||||||
|
@ -18,9 +18,6 @@ add_config "trusted-users = root $USER"
|
|||||||
if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then
|
if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then
|
||||||
add_config "$INPUT_EXTRA_NIX_CONFIG"
|
add_config "$INPUT_EXTRA_NIX_CONFIG"
|
||||||
fi
|
fi
|
||||||
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
|
|
||||||
add_config "experimental-features = nix-command flakes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Nix installer flags
|
# Nix installer flags
|
||||||
installer_options=(
|
installer_options=(
|
||||||
@ -38,7 +35,8 @@ if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then
|
|||||||
else
|
else
|
||||||
# "fix" the following error when running nix*
|
# "fix" the following error when running nix*
|
||||||
# error: the group 'nixbld' specified in 'build-users-group' does not exist
|
# error: the group 'nixbld' specified in 'build-users-group' does not exist
|
||||||
add_config "build-users-group ="
|
mkdir -m 0755 /etc/nix
|
||||||
|
echo "build-users-group =" > /etc/nix/nix.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
||||||
@ -47,7 +45,15 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "installer options: ${installer_options[@]}"
|
echo "installer options: ${installer_options[@]}"
|
||||||
sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") "${installer_options[@]}"
|
|
||||||
|
# There is --retry-on-errors, but only newer curl versions support that
|
||||||
|
until curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
chmod +x /tmp/install
|
||||||
|
sh /tmp/install "${installer_options[@]}"
|
||||||
|
|
||||||
if [[ $OSTYPE =~ darwin ]]; then
|
if [[ $OSTYPE =~ darwin ]]; then
|
||||||
# macOS needs certificates hints
|
# macOS needs certificates hints
|
||||||
|
Reference in New Issue
Block a user