cicd: cleanup and add building for windows-arm64
This commit is contained in:
parent
7642fda99f
commit
1666283f37
2 changed files with 17 additions and 14 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
|
@ -25,6 +25,7 @@ jobs:
|
|||
- linux-arm #
|
||||
- linux-x64 #
|
||||
- linux-x86 #
|
||||
- windows-arm64 #
|
||||
- windows-x64 # <-- No C library build - requires an additional adapted Makefile for `cl.exe` compiler
|
||||
- windows-x86 # -- // --
|
||||
- macos-arm64 # <-- MacOS M1/M2 - no tests, only CLI build to be published on release artifacts
|
||||
|
|
@ -38,6 +39,7 @@ jobs:
|
|||
- { runtime: linux-arm , target: arm-unknown-linux-gnueabihf , os: ubuntu-latest , use-cross: true }
|
||||
- { runtime: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-latest }
|
||||
- { runtime: linux-x86 , target: i686-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
|
||||
- { runtime: windows-arm64 , target: aarch64-pc-windows-msvc , os: windows-latest }
|
||||
- { runtime: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest }
|
||||
- { runtime: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest }
|
||||
- { runtime: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest }
|
||||
|
|
@ -49,8 +51,12 @@ jobs:
|
|||
- { runtime: linux-x86 , cc: i686-linux-gnu-gcc , ar: i686-linux-gnu-ar }
|
||||
|
||||
# See #2041 tree-sitter issue
|
||||
- { runtime: windows-x64 , rust_test_threads: 1 }
|
||||
- { runtime: windows-x86 , rust_test_threads: 1 }
|
||||
- { runtime: windows-x64 , rust-test-threads: 1 }
|
||||
- { runtime: windows-x86 , rust-test-threads: 1 }
|
||||
|
||||
# CLI only build
|
||||
- { runtime: windows-arm64 , cli-only: true }
|
||||
- { runtime: macos-arm64 , cli-only: true }
|
||||
|
||||
env:
|
||||
BUILD_CMD: cargo
|
||||
|
|
@ -102,14 +108,10 @@ jobs:
|
|||
echo "ENV DEBIAN_FRONTEND=noninteractive" >> Dockerfile
|
||||
echo "RUN apt-get update && apt-get install -y nodejs" >> Dockerfile
|
||||
docker build -t $image .
|
||||
docker images
|
||||
docker run --rm $image env
|
||||
|
||||
cd -
|
||||
|
||||
- name: Setup env extras
|
||||
env:
|
||||
RUST_TEST_THREADS: ${{ matrix.rust_test_threads }}
|
||||
RUST_TEST_THREADS: ${{ matrix.rust-test-threads }}
|
||||
USE_CROSS: ${{ matrix.use-cross }}
|
||||
CC: ${{ matrix.cc }}
|
||||
AR: ${{ matrix.ar }}
|
||||
|
|
@ -140,34 +142,34 @@ jobs:
|
|||
run: make.sh CFLAGS="-Werror" -j
|
||||
|
||||
- name: Build wasm library
|
||||
if: ${{ !matrix.use-cross && matrix.runtime != 'macos-arm64' }} # Not used
|
||||
if: ${{ !matrix.use-cross && !matrix.cli-only }}
|
||||
run: script/build-wasm
|
||||
|
||||
- name: Build CLI
|
||||
run: $BUILD_CMD build --release --target=${{ matrix.target }}
|
||||
|
||||
- name: Fetch fixtures
|
||||
if: ${{ matrix.runtime != 'macos-arm64' }} # Not used
|
||||
if: ${{ !matrix.cli-only }}
|
||||
run: script/fetch-fixtures
|
||||
|
||||
- name: Generate fixtures
|
||||
if: ${{ matrix.runtime != 'macos-arm64' }} # Can't natively run CLI on runner's host
|
||||
if: ${{ !matrix.cli-only }} # Can't natively run CLI on runner's host
|
||||
run: script/generate-fixtures
|
||||
|
||||
- name: Generate WASM fixtures
|
||||
if: ${{ !matrix.use-cross && matrix.runtime != 'macos-arm64' }} # Not used
|
||||
if: ${{ !matrix.use-cross && !matrix.cli-only }}
|
||||
run: script/generate-fixtures-wasm
|
||||
|
||||
- name: Run main tests
|
||||
if: ${{ matrix.runtime != 'macos-arm64' }} # Can't natively run CLI on runner's host
|
||||
if: ${{ !matrix.cli-only }} # Can't natively run CLI on runner's host
|
||||
run: $BUILD_CMD test --target=${{ matrix.target }}
|
||||
|
||||
- name: Run wasm tests
|
||||
if: ${{ !matrix.use-cross && matrix.runtime != 'macos-arm64' }} # Not used
|
||||
if: ${{ !matrix.use-cross && !matrix.cli-only }}
|
||||
run: script/test-wasm
|
||||
|
||||
- name: Run benchmarks
|
||||
if: ${{ !matrix.use-cross && matrix.runtime != 'macos-arm64' }} # Cross-compiled benchmarks make no sense
|
||||
if: ${{ !matrix.use-cross && !matrix.cli-only }} # Cross-compiled benchmarks make no sense
|
||||
run: $BUILD_CMD bench benchmark -p tree-sitter-cli --target=${{ matrix.target }}
|
||||
|
||||
- name: Upload CLI artifact
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ const matrix = {
|
|||
'win32': {
|
||||
name: 'windows',
|
||||
arch: {
|
||||
'arm64': { name: 'arm64' },
|
||||
'x64': { name: 'x64' },
|
||||
'x86': { name: 'x86' },
|
||||
'ia32': { name: 'x86' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue