Skip to content

Commit 80a00af

Browse files
committed
MacOS: Install ispc by downloading **versioned** release from GitHub
`brew` keeps horribly breaking, and a `brew install ispc` after a `brew upgrade` takes an insulting 13 minutes to also update all kinds of unrelated "formulae" that are irrelevant to the request to simply upgrade `ispc` (and direct dependencies). And it doesn't even allow us to pin the version to match the Linux and Windows jobs. This is simply solved by mimicking the Linux/Windows install process, by downloading the latest versioned `ispc` binary from GitHub, extracting it, and passing the path to `GITHUB_PATH`. Also clean up some inconsistencies in env var resolving, to all resolve them inside the shell script (via `$var` on UNIX and `$env:var` on Windows) as `${{ env.var }}` doesn't work in every context (i.e. to get to `GITHUB_PATH`).
1 parent 3b5c0b4 commit 80a00af

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- run: curl -L https://github.com/ispc/ispc/releases/download/v${{ env.ISPC_VERSION }}/ispc-v${{ env.ISPC_VERSION }}-linux.tar.gz | tar xzv ispc-v${{ env.ISPC_VERSION }}-linux/bin/ispc
16-
- run: realpath "ispc-v${{ env.ISPC_VERSION }}-linux/bin/" >> $GITHUB_PATH
15+
- run: curl -L https://github.com/ispc/ispc/releases/download/v$ISPC_VERSION/ispc-v$ISPC_VERSION-linux.tar.gz | tar xzv ispc-v$ISPC_VERSION-linux/bin/ispc
16+
- run: realpath "ispc-v$ISPC_VERSION-linux/bin/" >> $GITHUB_PATH
1717
- run: cargo build --all --all-targets --features ispc
1818
- run: cargo clippy --all --all-targets --features ispc -- -D warnings
1919
- run: cargo test --all
@@ -26,8 +26,10 @@ jobs:
2626
runs-on: macos-latest
2727
steps:
2828
- uses: actions/checkout@v4
29-
- run: brew update
30-
- run: brew install ispc
29+
- name: Prepare Environment
30+
run: |
31+
curl -L https://github.com/ispc/ispc/releases/download/v$ISPC_VERSION/ispc-v$ISPC_VERSION-macOS.x86_64.tar.gz | tar xzv ispc-v$ISPC_VERSION-macOS.x86_64/bin/ispc
32+
echo "$PWD/ispc-v$ISPC_VERSION-macOS.x86_64/bin/" >> $GITHUB_PATH
3133
- run: cargo build --all --all-targets --features ispc
3234
- run: cargo clippy --all --all-targets --features ispc -- -D warnings
3335
- run: cargo test --all
@@ -36,9 +38,9 @@ jobs:
3638
steps:
3739
- uses: actions/checkout@v4
3840
- run: |
39-
curl -LO https://github.com/ispc/ispc/releases/download/v${{ env.ISPC_VERSION }}/ispc-v${{ env.ISPC_VERSION }}-windows.zip
40-
unzip ispc-v${{ env.ISPC_VERSION }}-windows.zip ispc-v${{ env.ISPC_VERSION }}-windows/bin/ispc.exe
41-
Resolve-Path "ispc-v${{ env.ISPC_VERSION }}-windows/bin" | Add-Content -Path $env:GITHUB_PATH
41+
curl -LO https://github.com/ispc/ispc/releases/download/v$env:ISPC_VERSION/ispc-v$env:ISPC_VERSION-windows.zip
42+
unzip ispc-v$env:ISPC_VERSION-windows.zip ispc-v$env:ISPC_VERSION-windows/bin/ispc.exe
43+
Resolve-Path "ispc-v$env:ISPC_VERSION-windows/bin" | Add-Content -Path $env:GITHUB_PATH
4244
- run: cargo build --all --all-targets --features ispc
4345
- run: cargo clippy --all --all-targets --features ispc -- -D warnings
4446
- run: cargo test --all

0 commit comments

Comments
 (0)