-
Notifications
You must be signed in to change notification settings - Fork 63
87 lines (85 loc) · 3.45 KB
/
lsp-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Language server tests
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 8 * * 6'
workflow_dispatch:
workflow_call:
inputs:
all-platforms:
required: false
default: true
type: boolean
jobs:
test-lsp:
strategy:
matrix:
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.platform }}
steps:
# Uninstall operations are needed because the language server is able to use multiple
# different compilers for syntax checking. We test that it correctly detects which tools are
# present and responds appropriately.
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
repository: lf-lang/lingua-franca
submodules: true
ref: ${{ inputs.compiler-ref }}
fetch-depth: 0
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Uninstall packages Ubuntu
run: sudo apt-get remove clang-*
if: ${{ runner.os == 'Linux' }}
- name: Uninstall packages Windows
shell: pwsh
run: |
try { $exes=Get-Command "g++" -All; $exes | Remove-Item; } catch { "There is no g++ present in pwsh PATH." }
try { $exes=Get-Command "clang++" -All; $exes | Remove-Item; } catch { "There is no clang++ present in pwsh PATH." }
if: ${{ runner.os == 'Windows' }}
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
run: npm i -g pnpm
- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('core/src/main/resources/lib/ts/package.json') }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
rustflags: "" # don't use -D warnings
- name: Install Dependencies Ubuntu
run: |
sudo apt-get install libprotobuf-dev protobuf-compiler libprotobuf-c-dev protobuf-c-compiler
if: ${{ runner.os == 'Linux' }}
- name: Install Dependencies OS X
run: |
brew install protobuf
brew install protobuf-c
if: ${{ runner.os == 'macOS' }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run language server Python tests without PyLint
run: ./gradlew core:integrationTest --tests org.lflang.tests.lsp.LspTests.pythonValidationTestSyntaxOnly core:integrationTestCodeCoverageReport
- name: Install pylint
run: python3 -m pip install pylint
if: ${{ runner.os != 'macOS' }}
- name: Install pylint macOS
run: brew install pylint
if: ${{ runner.os == 'macOS' }}
- name: Run language server tests
run: ./gradlew core:integrationTest --tests org.lflang.tests.lsp.LspTests.*ValidationTest core:integrationTestCodeCoverageReport
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml
if: ${{ github.repository == 'lf-lang/lingua-franca' }}