Skip to content

Commit 25810ca

Browse files
devm33lydell
andauthored
chore: update Actions CI to use native runners instead of cross-compilation (#865)
* chore: update Actions CI to use native runners instead of cross-compilation * Remove cross-compiler installation for linux-arm * chore: move lint to a separate job * Skip compiling native addon for lint job Co-authored-by: Simon Lydell <simon.lydell@gmail.com> * ci: switch to using native objdump in verify-glibc script --------- Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
1 parent f228847 commit 25810ca

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,33 @@ on:
44
pull_request:
55

66
jobs:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-slim
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
16+
- name: Use Node.js 22.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22.x'
20+
21+
- name: Install dependencies (skip build)
22+
run: npm ci --ignore-scripts
23+
24+
- name: Lint
25+
run: npm run lint
26+
727
build-test:
8-
name: Build & Test (${{ matrix.os }}${{ matrix.cross && ' xarch' || '' }})
28+
name: Build & Test (${{ matrix.os }})
929
runs-on: ${{ matrix.os }}
1030
strategy:
1131
fail-fast: false
1232
matrix:
13-
os: [ubuntu-22.04, macos-14, windows-2022]
14-
cross: [false, true]
33+
os: [ubuntu-22.04, macos-14, windows-2022, macos-15-intel, ubuntu-22.04-arm, windows-11-arm]
1534
steps:
1635
- name: Checkout
1736
uses: actions/checkout@v4
@@ -27,25 +46,19 @@ jobs:
2746
id: arch
2847
shell: bash
2948
run: |
30-
if [ "${{ runner.os }}" = "macOS" ]; then
31-
echo "arch=${{ matrix.cross && 'x64' || 'arm64' }}" >> $GITHUB_OUTPUT
49+
if [ "${{ runner.arch }}" = "ARM64" ]; then
50+
echo "arch=arm64" >> $GITHUB_OUTPUT
3251
else
33-
echo "arch=${{ matrix.cross && 'arm64' || 'x64' }}" >> $GITHUB_OUTPUT
52+
echo "arch=x64" >> $GITHUB_OUTPUT
3453
fi
3554
3655
- name: Install sysroot
3756
if: runner.os == 'Linux'
3857
run: |
3958
sudo apt-get update -qq
40-
if [ "${{ steps.arch.outputs.arch }}" = "arm64" ]; then
41-
sudo apt-get install -y gcc-10-aarch64-linux-gnu g++-10-aarch64-linux-gnu
42-
echo "CC=aarch64-linux-gnu-gcc-10" >> $GITHUB_ENV
43-
echo "CXX=aarch64-linux-gnu-g++-10" >> $GITHUB_ENV
44-
else
45-
sudo apt-get install -y gcc-10 g++-10
46-
echo "CC=gcc-10" >> $GITHUB_ENV
47-
echo "CXX=g++-10" >> $GITHUB_ENV
48-
fi
59+
sudo apt-get install -y gcc-10 g++-10
60+
echo "CC=gcc-10" >> $GITHUB_ENV
61+
echo "CXX=g++-10" >> $GITHUB_ENV
4962
SYSROOT_PATH=$(node scripts/linux/install-sysroot.js ${{ steps.arch.outputs.arch }} | grep "SYSROOT_PATH=" | cut -d= -f2)
5063
echo "SYSROOT_PATH=$SYSROOT_PATH" >> $GITHUB_ENV
5164
echo "Sysroot path set to: $SYSROOT_PATH"
@@ -65,9 +78,4 @@ jobs:
6578
./scripts/linux/verify-glibc-requirements.sh
6679
6780
- name: Test
68-
if: ${{ !matrix.cross }}
6981
run: npm test
70-
71-
- name: Lint
72-
if: ${{ !matrix.cross }}
73-
run: npm run lint

scripts/linux/verify-glibc-requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for file in $files; do
2424
glibcxx_version=$version
2525
fi
2626
fi
27-
done < <("$SYSROOT_PATH/../bin/objdump" -T "$file")
27+
done < <(objdump -T "$file")
2828

2929
if [[ "$glibc_version" != "$EXPECTED_GLIBC_VERSION" ]]; then
3030
echo "Error: File $file has dependency on GLIBC > $EXPECTED_GLIBC_VERSION, found $glibc_version"

0 commit comments

Comments
 (0)