7676
7777 - name : Restore Cache & Discovery Results
7878 id : restore-cache
79- if : inputs.discovery_ssh == 'none'
79+ if : inputs.discovery_ssh == 'none' && runner.os != 'macOS'
80808181 with :
8282 path : |
9696 secret-key-files = ${{ env.NIX_KEY_PATH }}
9797 ${{ inputs.extra_nix_config }}
9898
99+ - name : Restore Cache & Discovery Results
100+ id : restore-cache-mac
101+ if : inputs.discovery_ssh == 'none' && runner.os == 'macOS'
102+ 103+ with :
104+ path : |
105+ /nix
106+ ~/.cache/nix
107+ ~root/.cache/nix
108+ key : discovery-${{ runner.os }}-${{ runner.arch }}-${{ github.ref }}-${{ github.sha }}
109+
99110 - name : Pull Derivations from Discovery Runner
100111 if : inputs.discovery_ssh != 'none'
101112 env :
@@ -117,8 +128,14 @@ runs:
117128 BUILDER : ${{ inputs.builder }}
118129 SSH_AUTH_SOCK : ${{ runner.temp }}/ssh_agent.sock
119130 JSON : ${{ inputs.json }}
131+ OS : ${{ runner.os }}
132+ SCRIPT : ${{ github.action_path }}/build.sh
120133 run : |
121- ${{ github.action_path }}/build.sh
134+ if [[ $OS == macOS ]]; then
135+ nix run nixpkgs/nixpkgs-22.11-darwin#bash -- "$SCRIPT"
136+ else
137+ "$SCRIPT"
138+ fi
122139 shell : bash
123140
124141 - name : ${{ fromJSON(inputs.json).action }} ${{ fromJSON(inputs.json).name }}
@@ -130,8 +147,14 @@ runs:
130147 JSON : ${{ inputs.json }}
131148 PRJ_ROOT : ${{ github.workspace }}
132149 PRJ_DATA_DIR : ${{ github.workspace }}/.std
150+ OS : ${{ runner.os }}
151+ SCRIPT : ${{ github.action_path }}/run.sh
133152 run : |
134- ${{ github.action_path }}/run.sh
153+ if [[ $OS == macOS ]]; then
154+ nix run nixpkgs/nixpkgs-22.11-darwin#bash -- "$SCRIPT"
155+ else
156+ "$SCRIPT"
157+ fi
135158 shell : bash
136159
137160 - name : Populate Cache
@@ -140,7 +163,13 @@ runs:
140163 BUILDER : ${{ inputs.builder }}
141164 UNCACHED : ${{ steps.build.outputs.uncached }}
142165 SSH_AUTH_SOCK : ${{ runner.temp }}/ssh_agent.sock
166+ OS : ${{ runner.os }}
167+ SCRIPT : ${{ github.action_path }}/cache.sh
143168 if : always() && env.CACHE != 'auto' && env.UNCACHED != '' && steps.build.conclusion == 'success'
144169 run : |
145- ${{ github.action_path }}/cache.sh
170+ if [[ $OS == macOS ]]; then
171+ nix run nixpkgs/nixpkgs-22.11-darwin#bash -- "$SCRIPT"
172+ else
173+ "$SCRIPT"
174+ fi
146175 shell : bash
0 commit comments