Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Support running under Node.js #111

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e9a7f03
Merge cmakelists changes
slavek-kucera Mar 10, 2021
d9dc743
refactor main loop
slavek-kucera Mar 12, 2021
db9a524
wasm support
slavek-kucera Mar 12, 2021
db21b14
move main loop back
slavek-kucera Mar 15, 2021
3eabe22
try removing event handlers
slavek-kucera Mar 15, 2021
d915482
clang format
slavek-kucera Mar 15, 2021
b2764a9
Introduce an option to select between native stdio/tcp client and wasm
slavek-kucera Mar 15, 2021
bdefc53
Build pipeline update
slavek-kucera Mar 15, 2021
e448735
tests are passing
slavek-kucera Mar 16, 2021
59d39c2
move utils to a separate library
slavek-kucera Mar 17, 2021
fd631eb
fix ci
slavek-kucera Mar 17, 2021
5bf7628
DISCOVER_TESTS=Off in wasm build
slavek-kucera Mar 17, 2021
07ec19b
disable pthread in gtest in wasm
slavek-kucera Mar 17, 2021
84798e8
copy wasm extras
slavek-kucera Mar 17, 2021
29e403e
instll libraries requried to run vscode
slavek-kucera Mar 17, 2021
dbc850f
Fake native language_server for tests
slavek-kucera Mar 17, 2021
42e6fc0
Force test exit
slavek-kucera Mar 18, 2021
0bb367a
use upload v2
slavek-kucera Mar 18, 2021
967b67b
Don't wait for me
slavek-kucera Mar 19, 2021
55fab6f
Refactor integration tests
slavek-kucera Mar 22, 2021
7936867
Listen for the correct end-of-stream event
slavek-kucera Mar 23, 2021
2fa5ebb
Split emscripten and native stream implementations
slavek-kucera Mar 24, 2021
664ca10
Possible race condition on queue termination
slavek-kucera Mar 24, 2021
e398e93
Update architecture documentation
slavek-kucera Mar 24, 2021
fa16045
Update build instruction with WASM details
slavek-kucera Mar 24, 2021
9d47824
Simplify wasm server start
slavek-kucera Mar 24, 2021
da13dfe
Split path utilities module
slavek-kucera Mar 25, 2021
d417dbd
Fixes
slavek-kucera Mar 25, 2021
8ce036d
Pipeline changes, split build and test
slavek-kucera Mar 30, 2021
c1fa27b
Merge branch 'development' of https://github.com/eclipse/che-che4z-ls…
slavek-kucera Apr 1, 2021
ac29782
Duplicate target in Emscripten build
slavek-kucera Apr 1, 2021
e382cbd
Pipeline optimization
slavek-kucera Apr 1, 2021
7ca986a
Antlr cmake refactoring
slavek-kucera Apr 1, 2021
35918ec
Doc changes
slavek-kucera Apr 1, 2021
aed3e1c
Even better title
slavek-kucera Apr 1, 2021
80f551f
...
slavek-kucera Apr 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 99 additions & 39 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,108 +26,168 @@ on:
- development

jobs:
win-server:
win-server-build:
name: Windows language server
runs-on: windows-2019

steps:
- uses: actions/checkout@v1
- name: Configure
shell: cmd
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ../
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_VSIX=Off ../
- name: Build
shell: cmd
run: cd build && cmake --build . --parallel --config Release
- name: Server Test
shell: cmd
run: cd build\bin && library_test.exe && server_test.exe
- name: Extension Test
shell: cmd
run: npm --prefix .\clients\vscode-hlasmplugin run test
- name: Extension Test Insiders
shell: cmd
run: npm --prefix .\clients\vscode-hlasmplugin run test:insiders
- name: Actions artifact
uses: actions/upload-artifact@v1
with:
name: language_server_win
name: language_server_win32
path: build/bin/language_server.exe

linux-server:
linux-server-build:
name: Linux language server
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: sudo apt-get update && sudo apt-get install uuid-dev g++-8 ninja-build
run: sudo apt-get update && sudo apt-get install -y uuid-dev ninja-build
- name: Configure
run: mkdir build && cd build && cmake -G Ninja -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 ../
run: mkdir build && cd build && cmake -G Ninja -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DBUILD_VSIX=Off ../
- name: Build
run: cd build && cmake --build .
- name: Server Test
run: cd build/bin && ./server_test && ./library_test
- name: Extension Test
uses: GabrielBB/[email protected]
with:
run: npm --prefix clients/vscode-hlasmplugin run test
- name: Extension Test Insiders
uses: GabrielBB/[email protected]
with:
run: npm --prefix clients/vscode-hlasmplugin run test:insiders
- name: Actions artifact
uses: actions/upload-artifact@v1
with:
name: language_server_linux
path: build/bin/language_server

macos-server:
wasm-server-build:
name: WASM language server
runs-on: ubuntu-20.04
container: emscripten/emsdk:2.0.12

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: sudo apt-get update && sudo apt-get install -y ninja-build maven
- name: Configure
run: >
mkdir build && cd build && emcmake cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDISCOVER_TESTS=Off
-DWITH_LIBCXX=Off -DWITH_STATIC_CRT=Off -DCMAKE_EXE_LINKER_FLAGS="-s NODERAWFS=1"
-DCMAKE_CXX_FLAGS="-s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=8 -s TOTAL_MEMORY=268435456 -s PROXY_TO_PTHREAD=1 -fexceptions -s NODERAWFS=1 -s EXIT_RUNTIME=1 --bind"
-DCMAKE_CROSSCOMPILING_EMULATOR="node;--experimental-wasm-threads;--experimental-wasm-bulk-memory"
-Dgtest_disable_pthreads=On -DBUILD_VSIX=Off ../
- name: Build
run: cd build && cmake --build .
- name: Server Test
run: cd build/bin && node --experimental-wasm-threads --experimental-wasm-bulk-memory ./server_test.js && node --experimental-wasm-threads --experimental-wasm-bulk-memory ./library_test.js
- name: Actions artifact
uses: actions/upload-artifact@v2
with:
name: language_server_wasm
path: build/bin/language_server.*

macos-server-build:
name: MacOS language server
runs-on: macos-10.15

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: |
brew install ninja llvm@8
export PATH=~/usr/local/opt/llvm\@8/bin:$PATH
run: brew install ninja
- name: Configure
run: mkdir build && cd build && cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_PATH=/usr/local/opt/llvm\@8 ../
run: >
mkdir build && cd build && cmake -G Ninja
-DCMAKE_C_COMPILER=$(brew --prefix llvm)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++
-DLLVM_PATH=$(brew --prefix llvm) -DBUILD_VSIX=Off ../
- name: Build
run: cd build && cmake --build . -- -v
- name: Server Test
run: cd build/bin && ./server_test && ./library_test
- name: Extension Test
run: npm --prefix clients/vscode-hlasmplugin run test
# Remove the insiders test until it is clear where is the problem with freezing of the test
# - name: Extension Test Insiders
# run: npm --prefix clients/vscode-hlasmplugin run test:insiders
- name: Actions artifact
uses: actions/upload-artifact@v1
with:
name: language_server_macos
name: language_server_darwin
path: build/bin/language_server

test-matrix:
name: Test
runs-on: ${{ matrix.os }}
needs: [win-server-build, linux-server-build, wasm-server-build, macos-server-build]
strategy:
matrix:
include:
- os: ubuntu-20.04
native: linux
chmod: true
- os: windows-2019
native: win32
chmod: false
- os: macos-10.15
native: darwin
chmod: true

steps:
- uses: actions/checkout@v1
- name: Download native language server
uses: actions/download-artifact@v1
with:
name: language_server_${{ matrix.native }}
path: clients/vscode-hlasmplugin/bin/${{ matrix.native }}/
- name: Run chmod
if: ${{ matrix.chmod }}
run: chmod +x clients/vscode-hlasmplugin/bin/${{ matrix.native }}/language_server
- name: Download wasm language server
uses: actions/download-artifact@v1
with:
name: language_server_wasm
path: clients/vscode-hlasmplugin/bin/wasm/
- name: NPM CI
run: npm --prefix clients/vscode-hlasmplugin ci
- name: Extension Test
uses: GabrielBB/[email protected]
with:
run: npm --prefix clients/vscode-hlasmplugin run test
- name: Extension Test WASM
uses: GabrielBB/[email protected]
with:
run: npm --prefix clients/vscode-hlasmplugin run test:wasm
- name: Extension Test Insiders
uses: GabrielBB/[email protected]
with:
run: npm --prefix clients/vscode-hlasmplugin run test:insiders

VSIX:
runs-on: ubuntu-18.04
needs: [win-server, linux-server, macos-server]
runs-on: ubuntu-20.04
needs: [test-matrix]

steps:
- uses: actions/checkout@v1
- name: Download windows language server
uses: actions/download-artifact@v1
with:
name: language_server_win
name: language_server_win32
path: clients/vscode-hlasmplugin/bin/win32/
- name: Download linux language server
uses: actions/download-artifact@v1
with:
name: language_server_linux
path: clients/vscode-hlasmplugin/bin/linux/
- name: Download wasm language server
uses: actions/download-artifact@v1
with:
name: language_server_wasm
path: clients/vscode-hlasmplugin/bin/wasm/
- name: Download MacOS language server
uses: actions/download-artifact@v1
with:
name: language_server_macos
name: language_server_darwin
path: clients/vscode-hlasmplugin/bin/darwin/
- name: Set executable flag
run: |
Expand All @@ -154,7 +214,7 @@ jobs:

alpine-VSIX:
name: Alpine VSIX
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
container:
image: alpine:3.10

Expand Down Expand Up @@ -191,7 +251,7 @@ jobs:

release:
name: Release VSIXs
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release'))
needs: [alpine-VSIX, VSIX]

Expand Down Expand Up @@ -265,7 +325,7 @@ jobs:

theia-test:
name: Theia Integration Test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: alpine-VSIX
strategy:
matrix:
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/Check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,42 @@ on:
jobs:
clang-asan:
name: Clang ASAN, UBSAN
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-8-dev libc++abi-8-dev
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-10-dev libc++abi-10-dev
- name: Configure
run: mkdir build && cd build && cmake -G Ninja -DBUILD_VSIX=Off -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined" ../
run: mkdir build && cd build && cmake -G Ninja -DBUILD_VSIX=Off -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined" ../
- name: Build
run: cd build && cmake --build .
- name: Test
run: cd build/bin && ./server_test && ./library_test

clang-tsan:
name: Clang TSAN
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-8-dev libc++abi-8-dev
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-10-dev libc++abi-10-dev
- name: Configure
run: mkdir build && cd build && cmake -G Ninja -DBUILD_VSIX=Off -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_CXX_FLAGS="-fsanitize=thread" ../
run: mkdir build && cd build && cmake -G Ninja -DBUILD_VSIX=Off -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS="-fsanitize=thread" ../
- name: Build
run: cd build && cmake --build .
- name: Test
run: cd build/bin && ./server_test && ./library_test

clang-format-check:
name: Code format
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- name: Requirements install
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
sudo apt-get update
sudo apt-get install -y clang-format-10
run: sudo apt-get install -y clang-format-10
- name: Run clang-format
run: clang-format-10 -style=file -n $(find . -name \*.h -print -o -name \*.cpp -print) 2>&1 | tee clang-format-output.txt
- name: Upload clang-format-output.txt
Expand All @@ -83,7 +79,7 @@ jobs:

license-headers:
name: License headers check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Check license headers
Expand All @@ -93,7 +89,7 @@ jobs:

pr-base-check:
name: Master PR check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
steps:
- name: Check, whether PR to master is from a release branch
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/Sonarcloud-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ on:
jobs:
sonarcloud-build:
name: SonarCloud build
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Get version
run: echo "VERSION=$(node -e "console.log(require('./clients/vscode-hlasmplugin/package.json').version)")" >> $GITHUB_ENV
- name: Requirements install
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-8-dev libc++abi-8-dev
run: sudo apt-get update && sudo apt-get install uuid-dev ninja-build libc++-10-dev libc++abi-10-dev
- name: Configure
run: >
mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=clang-8
-DCMAKE_CXX_COMPILER=clang++-8
-DCMAKE_C_COMPILER=clang-10
-DCMAKE_CXX_COMPILER=clang++-10
-DCMAKE_CXX_FLAGS="-fprofile-instr-generate -fcoverage-mapping"
../
- name: Sonar build wrapper download
Expand All @@ -61,9 +61,9 @@ jobs:
with:
run: npm --prefix clients/vscode-hlasmplugin test
- name: Merge raw profiles
run: cd build/bin && llvm-profdata-8 merge -o hlasm_profile library.rawprof server.rawprof
run: cd build/bin && llvm-profdata-10 merge -o hlasm_profile library.rawprof server.rawprof
- name: Generate lcov coverage
run: cd build/bin && llvm-cov-8 show -instr-profile hlasm_profile library_test -object server_test > ../coverage.txt
run: cd build/bin && llvm-cov-10 show -instr-profile hlasm_profile library_test -object server_test > ../coverage.txt
- name: Pull request event info
if: github.event_name == 'pull_request'
run: |
Expand Down
Loading