Language Server Simulator #840
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Language Server Simulator | |
on: | |
schedule: | |
- cron: '0 */12 * * *' | |
workflow_dispatch: | |
jobs: | |
run_simulator: | |
name: Run LS Simulator | |
runs-on: ubuntu-latest | |
timeout-minutes: 240 | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: ["master", "2201.0.x", "2201.1.x", "2201.2.x", "2201.2.0-stage"] | |
skipGenerators: ["", "IMPORT_STATEMENT"] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Initialize sub-modules | |
run: git submodule update --init | |
- name: Build with Gradle | |
timeout-minutes: 180 | |
run: | | |
export DISPLAY=':99.0' | |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
./gradlew clean :language-server-simulator:runLSSimulator -Dls.simulation.skipGenerators=${{ matrix.skipGenerators }} | |
- name: Check Simulation Failure | |
run: if test -f dump.hprof; then exit 1; else exit 0; fi | |
- name: Analyze Heap Dump If Exists | |
if: failure() | |
run: | | |
if test -f dump.hprof; then echo "Heap sump exists. Analyzing..."; else exit 0; fi | |
wget https://ftp.jaist.ac.jp/pub/eclipse/mat/1.12.0/rcp/MemoryAnalyzer-1.12.0.20210602-linux.gtk.x86_64.zip | |
unzip MemoryAnalyzer-1.12.0.20210602-linux.gtk.x86_64.zip | |
./mat/ParseHeapDump.sh ./dump.hprof org.eclipse.mat.api:suspects | |
- name: Upload Heap Dumps | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: heap_dump-${{ matrix.branch }}.hprof | |
path: '*.hprof' | |
- name: Upload Leaks Suspects | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: Leak_Suspects-${{ matrix.branch }} | |
path: 'dump_Leak_Suspects.zip' | |
- name: Notify failure | |
if: failure() | |
run: | | |
curl \ | |
-X POST 'https://chat.googleapis.com/v1/spaces/${{secrets.NOTIFICATIONS_CHAT_ID}}/messages?key=${{secrets.NOTIFICATIONS_CHAT_KEY}}&token=${{secrets.NOTIFICATIONS_CHAT_TOKEN}}' \ | |
--header 'Content-Type: application/json' \ | |
-d '{"text": "*language server simulator failure in ${{ matrix.branch }}* (skipped generators: ${{ matrix.skipGenerators }}) \nPlease \n visit <https://github.com/ballerina-platform/ballerina-lang/actions/runs/${{github.run_id}}|the LS simulator run> for more information"}' | |