cicd: build CLI for macos-arm64
This commit is contained in:
parent
bbcf1e3746
commit
52f22a65eb
2 changed files with 11 additions and 9 deletions
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
|
|
@ -6,6 +6,7 @@ env:
|
|||
CROSS_DEBUG: 1
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ref:
|
||||
|
|
@ -27,6 +28,7 @@ jobs:
|
|||
- { name: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest }
|
||||
- { name: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest }
|
||||
- { name: macos-x64 , target: x86_64-apple-darwin , os: macos-latest }
|
||||
- { name: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest }
|
||||
|
||||
env:
|
||||
BUILD_CMD: cargo
|
||||
|
|
@ -125,30 +127,34 @@ jobs:
|
|||
run: make.sh CFLAGS="-Werror" -j
|
||||
|
||||
- name: Build wasm library
|
||||
if: ${{ !matrix.job.use-cross && matrix.job.name != 'macos-arm64' }} # Not used
|
||||
run: script/build-wasm
|
||||
|
||||
- name: Build CLI
|
||||
run: $BUILD_CMD build --release --target=${{ matrix.job.target }}
|
||||
|
||||
- name: Fetch fixtures
|
||||
if: ${{ matrix.job.name != 'macos-arm64' }} # Not used
|
||||
run: script/fetch-fixtures
|
||||
|
||||
- name: Generate fixtures
|
||||
if: ${{ matrix.job.name != 'macos-arm64' }} # Can't run CLI on host
|
||||
run: script/generate-fixtures
|
||||
|
||||
- name: Generate WASM fixtures
|
||||
if: "!matrix.job.use-cross"
|
||||
if: ${{ !matrix.job.use-cross && matrix.job.name != 'macos-arm64' }} # Not used
|
||||
run: script/generate-fixtures-wasm
|
||||
|
||||
- name: Run main tests
|
||||
if: ${{ matrix.job.name != 'macos-arm64' }} # Can't run CLI on host
|
||||
run: $BUILD_CMD test --target=${{ matrix.job.target }}
|
||||
|
||||
- name: Run wasm tests
|
||||
if: "!matrix.job.use-cross" # TODO: Install Emscripten into custom cross images
|
||||
if: ${{ !matrix.job.use-cross && matrix.job.name != 'macos-arm64' }} # Not used
|
||||
run: script/test-wasm
|
||||
|
||||
- name: Run benchmarks
|
||||
if: "!matrix.job.use-cross" # It doesn't make sense to benchmark something in an emulator
|
||||
if: ${{ !matrix.job.use-cross && matrix.job.name != 'macos-arm64' }} # Cross-compiled benchmarks make no sense
|
||||
run: $BUILD_CMD bench benchmark -p tree-sitter-cli --target=${{ matrix.job.target }}
|
||||
|
||||
- name: Upload CLI artifact
|
||||
|
|
|
|||
|
|
@ -16,14 +16,10 @@ const platformName = {
|
|||
let archName = {
|
||||
'x64': 'x64',
|
||||
'x86': 'x86',
|
||||
'ia32': 'x86'
|
||||
'ia32': 'x86',
|
||||
'arm64': 'arm64'
|
||||
}[process.arch];
|
||||
|
||||
// ARM macs can run x64 binaries via Rosetta. Rely on that for now.
|
||||
if (platformName === 'macos' && process.arch === 'arm64') {
|
||||
archName = 'x64';
|
||||
}
|
||||
|
||||
if (!platformName || !archName) {
|
||||
console.error(
|
||||
`Cannot install tree-sitter-cli for platform ${process.platform}, architecture ${process.arch}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue