Skip to content

Commit

Permalink
Build arm64 arches
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Feb 26, 2024
1 parent f20fb63 commit 911c198
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,37 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
arch: [x64, arm64]
os: [ubuntu-22.04, windows-2022, macos-14]
arch: [x64]
include:
- os: ubuntu-22.04
arch: x86
- os: ubuntu-22.04
arch: arm
- os: windows-2022
arch: x86
arch: arm64
- os: macos-14
arch: arm64

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Linux Arm Toolchains
if: runner.os == 'linux' && matrix.arch == 'arm64'
run: sudo apt install -y binutils-aarch64-linux-gnu

- uses: actions/setup-python@v4
- name: Use Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.x
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3

- name: Build
run: |
node scripts/bootstrap.js --target-cpu=x64
node scripts/bootstrap.js --target-cpu=${{ matrix.arch }}
node scripts/build.js out/Release
- name: Create distribution
run: node scripts/create_dist.js

- name: Run tests
if: runner.arch == matrix.arch
run: node scripts/test.js

- name: Upload
Expand Down
1 change: 1 addition & 0 deletions scripts/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {targetCpu, targetOs, execSync, spawnSync} = require('./common')

// Get the arch of sysroot.
let sysrootArch = {
arm64: 'arm64',
x64: 'amd64',
x86: 'i386',
}[targetCpu]
Expand Down
5 changes: 4 additions & 1 deletion scripts/create_dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,8 @@ function searchFiles(dir, list = []) {

function strip(file) {
// TODO(zcbenz): Copy the debug symbols out before striping.
execSync(`strip ${file}`)
if (targetCpu == 'x64')
execSync(`strip ${file}`)
else
execSync(`aarch64-linux-gnu-strip ${file}`)
}
3 changes: 0 additions & 3 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ async function main() {
}

function runTests(error) {
if (targetCpu !== 'x64' && targetOs !== 'win') {
return
}
for (const project of fs.readdirSync('examples')) {
runEachTest(project, path.resolve('examples', project))
}
Expand Down

0 comments on commit 911c198

Please sign in to comment.