Skip to content

Commit b56a74d

Browse files
committed
use node for universal runner
1 parent eb19d4c commit b56a74d

2 files changed

Lines changed: 29 additions & 26 deletions

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
pull_request:
66
schedule:
7-
- cron: '14 3 15 * *' # Runs at 03:14 UTC on the 15th of every month
7+
- cron: "14 3 15 * *" # Runs at 03:14 UTC on the 15th of every month
88
push:
99
branches:
1010
- main
@@ -27,30 +27,32 @@ jobs:
2727
uses: actions/cache@v4
2828
with:
2929
path: vcpkg_installed
30-
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
30+
key: vcpkg-${{ runner.os }}-${{ hashFiles("vcpkg.json") }}
3131

3232
- name: Export vcpkg host triplet for compilation
33-
shell: bash
33+
shell: node
3434
run: |
35-
declare -A tripletMapping=(
36-
["Linux"]="x64-linux"
37-
["Windows"]="x64-windows-static-md"
38-
["macOS"]="arm64-osx"
39-
)
40-
export VCPKG_HOST_TRIPLET="${tripletMapping[$RUNNER_OS]}"
41-
echo VCPKG_HOST_TRIPLET="$VCPKG_HOST_TRIPLET" >> $GITHUB_ENV
42-
echo "$VCPKG_HOST_TRIPLET"
35+
const mapping = {
36+
Linux: "x64-linux",
37+
Windows: "x64-windows-static-md",
38+
macOS: "arm64-osx"
39+
};
40+
const value = mapping[process.env.RUNNER_OS];
41+
const fs = require("fs");
42+
fs.appendFileSync(process.env.GITHUB_ENV, `VCPKG_HOST_TRIPLET=${value}\n`);
43+
print(value);
44+
4345
4446
- name: Acquire vcpkg
45-
if: steps.cache-vcpkg-deps.outputs.cache-hit != 'true'
47+
if: steps.cache-vcpkg-deps.outputs.cache-hit != "true"
4648
uses: actions/checkout@v4
4749
with:
4850
repository: "Microsoft/vcpkg"
4951
path: vcpkg
5052
ref: c9c17dcea3016bc241df0422e82b8aea212dcb93
5153

5254
- name: Install libraries with vcpkg.json
53-
if: steps.cache-vcpkg-deps.outputs.cache-hit != 'true'
55+
if: steps.cache-vcpkg-deps.outputs.cache-hit != "true"
5456
shell: bash
5557
run: |
5658
./vcpkg/bootstrap-vcpkg.sh
@@ -66,7 +68,7 @@ jobs:
6668
cache-dependency-glob: "**/pyproject.toml"
6769

6870
- name: Build pybmds
69-
if: runner.os != 'Windows'
71+
if: runner.os != "Windows"
7072
run: |
7173
uv pip install pybind11==3.0.0 --target=./pybind11
7274
@@ -82,7 +84,7 @@ jobs:
8284
py.test
8385
8486
- name: Build pybmds
85-
if: runner.os == 'Windows'
87+
if: runner.os == "Windows"
8688
run: |
8789
uv pip install pybind11==3.0.0 --target=./pybind11
8890

.github/workflows/wheels.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
pull_request:
66
schedule:
7-
- cron: '14 3 15 * *' # Runs at 03:14 UTC on the 15th of every month
7+
- cron: "14 3 15 * *" # Runs at 03:14 UTC on the 15th of every month
88
push:
99
branches:
1010
- main
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/cache@v4
2727
with:
2828
path: vcpkg_installed
29-
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
29+
key: vcpkg-${{ runner.os }}-${{ hashFiles("vcpkg.json") }}
3030

3131
- name: Acquire vcpkg
3232
uses: actions/checkout@v4
@@ -36,16 +36,17 @@ jobs:
3636
ref: c9c17dcea3016bc241df0422e82b8aea212dcb93
3737

3838
- name: Export vcpkg host triplet for compilation
39-
shell: bash
39+
shell: node
4040
run: |
41-
declare -A tripletMapping=(
42-
["Linux"]="x64-linux"
43-
["Windows"]="x64-windows-static-md"
44-
["macOS"]="arm64-osx"
45-
)
46-
export VCPKG_HOST_TRIPLET="${tripletMapping[$RUNNER_OS]}"
47-
echo VCPKG_HOST_TRIPLET="$VCPKG_HOST_TRIPLET" >> $GITHUB_ENV
48-
echo "$VCPKG_HOST_TRIPLET"
41+
const mapping = {
42+
Linux: "x64-linux",
43+
Windows: "x64-windows-static-md",
44+
macOS: "arm64-osx"
45+
};
46+
const value = mapping[process.env.RUNNER_OS];
47+
const fs = require("fs");
48+
fs.appendFileSync(process.env.GITHUB_ENV, `VCPKG_HOST_TRIPLET=${value}\n`);
49+
print(value);
4950
5051
- uses: pypa/cibuildwheel@v3.1.3
5152
env:

0 commit comments

Comments
 (0)