Fix Catalina
This commit is contained in:
		
							
								
								
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -6,7 +6,7 @@ jobs: | |||||||
|   tests: |   tests: | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-18.04, macos] |         os: [ubuntu-18.04, macos-latest] | ||||||
|     runs-on: ${{ matrix.os }} |     runs-on: ${{ matrix.os }} | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v1 |     - uses: actions/checkout@v1 | ||||||
| @@ -17,4 +17,4 @@ jobs: | |||||||
|     - run: yarn test |     - run: yarn test | ||||||
|     - name: Install Nix |     - name: Install Nix | ||||||
|       uses: ./ |       uses: ./ | ||||||
|     - run: nix-build test.nix |     - run: nix-build test.nix | ||||||
|   | |||||||
| @@ -33,6 +33,10 @@ function run() { | |||||||
|             yield exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]); |             yield exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]); | ||||||
|             // Set jobs to number of cores |             // Set jobs to number of cores | ||||||
|             yield exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); |             yield exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); | ||||||
|  |             // Catalina workaround https://github.com/NixOS/nix/issues/2925 | ||||||
|  |             if (os_1.type() == "Darwin") { | ||||||
|  |                 yield exec.exec("sudo", ["mount", "-uw", "/"]); | ||||||
|  |             } | ||||||
|             // TODO: retry due to all the things that go wrong |             // TODO: retry due to all the things that go wrong | ||||||
|             const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); |             const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); | ||||||
|             yield exec.exec("sh", [nixInstall]); |             yield exec.exec("sh", [nixInstall]); | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import * as core from '@actions/core'; | import * as core from '@actions/core'; | ||||||
| import * as exec from '@actions/exec'; | import * as exec from '@actions/exec'; | ||||||
| import * as tc from '@actions/tool-cache'; | import * as tc from '@actions/tool-cache'; | ||||||
| import {homedir, userInfo} from 'os'; | import {homedir, userInfo, type} from 'os'; | ||||||
| import {existsSync} from 'fs'; | import {existsSync} from 'fs'; | ||||||
|  |  | ||||||
| async function run() { | async function run() { | ||||||
| @@ -18,6 +18,11 @@ async function run() { | |||||||
|     // Set jobs to number of cores |     // Set jobs to number of cores | ||||||
|     await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); |     await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); | ||||||
|  |  | ||||||
|  |     // Catalina workaround https://github.com/NixOS/nix/issues/2925 | ||||||
|  |     if (type() == "Darwin") { | ||||||
|  |       await exec.exec("sudo", ["mount", "-uw", "/"]); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     // TODO: retry due to all the things that go wrong |     // TODO: retry due to all the things that go wrong | ||||||
|     const nixInstall = await tc.downloadTool('https://nixos.org/nix/install'); |     const nixInstall = await tc.downloadTool('https://nixos.org/nix/install'); | ||||||
|     await exec.exec("sh", [nixInstall]); |     await exec.exec("sh", [nixInstall]); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user