Merge branch 'setup-ci'
This commit is contained in:
35
.github/workflows/tests.yml
vendored
Normal file
35
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
CMAKE_VERSION: 3.14.7
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04]
|
||||
python: [3.6, 3.7, 3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Cache .tox
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: .tox
|
||||
key: ${{ runner.OS }}-tox-${{ hashFiles('poetry.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-tox-
|
||||
- name: Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl -sSL https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz | tar xz
|
||||
python -m pip install --upgrade setuptools pip wheel
|
||||
python -m pip install poetry tox-gh-actions
|
||||
- name: Test with tox
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/cmake-$CMAKE_VERSION-Linux-x86_64/bin:$PATH
|
||||
tox
|
||||
@@ -1,4 +1,5 @@
|
||||
# cmake-language-server
|
||||
[](https://github.com/regen100/cmake-language-server/actions)
|
||||
|
||||
CMake LSP Implementation.
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ class API(object):
|
||||
|
||||
proc = subprocess.run([self._cmake, self._build],
|
||||
universal_newlines=True,
|
||||
capture_output=True)
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
self.query_json.unlink()
|
||||
self.query_json.parent.rmdir()
|
||||
if proc.returncode != 0:
|
||||
@@ -133,7 +134,8 @@ endforeach()
|
||||
p = subprocess.run([self._cmake, '-P', tmplist],
|
||||
cwd=cmake_files['paths']['source'],
|
||||
universal_newlines=True,
|
||||
capture_output=True)
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
if p.returncode != 0:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def cmake_build(shared_datadir):
|
||||
from subprocess import run
|
||||
from subprocess import run, PIPE
|
||||
source = shared_datadir / 'cmake'
|
||||
build = source / 'build'
|
||||
build.mkdir()
|
||||
p = run(['cmake', '-S', source, '-B', build],
|
||||
run(['cmake', source],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
cwd=build,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE,
|
||||
universal_newlines=True)
|
||||
logging.debug(p.stdout)
|
||||
logging.debug(p.stderr)
|
||||
yield build
|
||||
|
||||
@@ -43,8 +43,9 @@ def test_parse_commands(cmake_build):
|
||||
api.parse_doc()
|
||||
|
||||
p = subprocess.run(['cmake', '--help-command-list'],
|
||||
capture_output=True,
|
||||
universal_newlines=True)
|
||||
universal_newlines=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
commands = p.stdout.strip().split('\n')
|
||||
|
||||
for command in commands:
|
||||
@@ -59,8 +60,9 @@ def test_parse_variables(cmake_build):
|
||||
api.parse_doc()
|
||||
|
||||
p = subprocess.run(['cmake', '--help-variable-list'],
|
||||
capture_output=True,
|
||||
universal_newlines=True)
|
||||
universal_newlines=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
variables = p.stdout.strip().split('\n')
|
||||
|
||||
for variable in variables:
|
||||
|
||||
Reference in New Issue
Block a user