Skip to content

Use of tree_sitter for symbol provider #94

Use of tree_sitter for symbol provider

Use of tree_sitter for symbol provider #94

Workflow file for this run

name: Build Extension
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
env:
CARGO_TERM_COLOR: always
jobs:
build-desktop:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest] # ubuntu-latest, macos-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --check
# Download dxc dll for tests.
- name: Download dxc dll.
uses: robinraju/[email protected]
with:
repository: 'microsoft/DirectXShaderCompiler'
tag: v1.8.2405
fileName: 'dxc_2024_05_24.zip'
extract: true
out-file-path: './dxc'
- name: Create target folder
run: mkdir -p ./target/debug
- name: Copy dxc dll to target folder for tests.
run: cp ./dxc/bin/x64/dxcompiler.dll ./target/debug/dxcompiler.dll && cp ./dxc/bin/x64/dxil.dll ./target/debug/dxil.dll
- name: Run tests
run: cargo test --verbose
- name: Build desktop executable
run: cargo build --release --verbose
- name: Copy desktop executable
run: mkdir -p ./bin/ && cp ./target/release/shader_language_server.exe ./bin/shader_language_server.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: desktop
path: ./bin/
build-wasi:
runs-on: ubuntu-latest
# Skip WASI for now as tree-sitter does not build on WASI.
if: ${{ vars.COMPILE_WASI == 'true' }}
# Build WASM from source.
steps:
- uses: actions/checkout@v4
- uses: robinraju/[email protected]
with:
repository: 'WebAssembly/wasi-sdk'
tag: 'wasi-sdk-24'
fileName: 'wasi-sysroot-24.0.tar.gz'
extract: true
- name: Setup WASI_SYSROOT
run: |
echo "WASI_SYSROOT=$(echo $GITHUB_WORKSPACE)/wasi-sysroot-24.0/" >> $GITHUB_ENV
echo $WASI_SYSROOT
ls -f $WASI_SYSROOT
- name: Download latest clang
run: |
sudo apt update
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
clang --version
clang-17 --version
- name: Add target
run: rustup target add wasm32-wasip1-threads
- name: Build WASI executable
run: cargo build --release --target wasm32-wasip1-threads --verbose
env: # Somehow this VM has clang14 by default, which is not supported...
CC: clang-17
CXX: clang++-17
- name: Copy WASI executables
run: mkdir -p ./bin/ && cp ./target/wasm32-wasip1-threads/release/shader_language_server.wasm ./bin/shader_language_server.wasm
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wasi
path: ./bin/