Compare commits
	
		
			4 Commits
		
	
	
		
			resilient-
			...
			self-hoste
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 39d848c6d3 | ||
|  | 8ba86cf165 | ||
|  | 712fbc2bf9 | ||
|  | c5729e9110 | 
							
								
								
									
										10
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.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.3.5 |     - uses: actions/checkout@v2.3.4 | ||||||
|     - 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.3.5 |     - uses: actions/checkout@v2.3.4 | ||||||
|     - 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.3.5 |     - uses: actions/checkout@v2.3.4 | ||||||
|     - 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.3.5 |     - uses: actions/checkout@v2.3.4 | ||||||
|     - run: yarn install --frozen-lockfile |     - run: yarn install --frozen-lockfile | ||||||
|     - run: yarn build |     - run: yarn build | ||||||
|     - name: Install Nix |     - name: Install Nix | ||||||
| @@ -84,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.3.5 |     - uses: actions/checkout@v2 | ||||||
|     - run: yarn install --frozen-lockfile |     - run: yarn install --frozen-lockfile | ||||||
|     - run: yarn build |     - run: yarn build | ||||||
|     - name: Install Nix |     - name: Install Nix | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ or [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs.html) | |||||||
| - Quick installation (~4s on Linux, ~20s on macOS) | - Quick installation (~4s on Linux, ~20s on macOS) | ||||||
| - Multi-User installation (with sandboxing enabled only on Linux) | - Multi-User installation (with sandboxing enabled only on Linux) | ||||||
| - [Self-hosted github runner](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support | - [Self-hosted github runner](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support | ||||||
| - Allows specifying Nix installation URL via `install_url` (the oldest supported Nix version is 2.3.5) | - Allows specifying Nix installation URL via `install_url` | ||||||
| - 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 | ||||||
|   | |||||||
| @@ -1,6 +1,9 @@ | |||||||
| #!/usr/bin/env bash | #!/usr/bin/env bash | ||||||
| set -euo pipefail | set -euo pipefail | ||||||
|  |  | ||||||
|  | # Set paths early (ephemeral self-hosted runners might reuse a runner) | ||||||
|  | PATH="/nix/var/nix/profiles/per-user/$USER/profile/bin":"/nix/var/nix/profiles/default/bin":$PATH | ||||||
|  |  | ||||||
| if type -p nix &>/dev/null ; then | if type -p nix &>/dev/null ; then | ||||||
|   echo "Aborting: Nix is already installed at $(type -p nix)" |   echo "Aborting: Nix is already installed at $(type -p nix)" | ||||||
|   exit |   exit | ||||||
| @@ -45,15 +48,7 @@ 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 | ||||||
| @@ -67,6 +62,7 @@ fi | |||||||
| echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" | echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" | ||||||
| echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" | echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" | ||||||
|  |  | ||||||
|  |  | ||||||
| if [[ $INPUT_NIX_PATH != "" ]]; then | if [[ $INPUT_NIX_PATH != "" ]]; then | ||||||
|   echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV" |   echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV" | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user