Skip to content

Commit

Permalink
appveyor: run test on multiple pythons versions and also on linux
Browse files Browse the repository at this point in the history
Some checks of the example extensions only run on windows, because it
was not adapted.
  • Loading branch information
perrinjerome committed Jan 28, 2020
1 parent 29f4fbb commit adcc10d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 53 deletions.
96 changes: 60 additions & 36 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,63 @@ on_failure:
if ($fileobj) { cat $fileobj; };
}
image:
- Visual Studio 2017
stack: python %PYTHON%

environment:
APPVEYOR_YML_DISABLE_PS_LINUX: true
PYTHONEXE: python
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TOXENV: py35
PYTHON: "3.5"
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TOXENV: py36
PYTHON: "3.6"
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TOXENV: py37
PYTHON: "3.7"
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TOXENV: py38
PYTHON: "3.8"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOXENV: py35
PYTHON: "3.5"
PYTHONDIR: C:\Python35-x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOXENV: py36
PYTHON: "3.6"
PYTHONDIR: C:\Python36-x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOXENV: py37
PYTHON: "3.7"
PYTHONDIR: C:\Python37-x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOXENV: py38
PYTHON: "3.8"
PYTHONDIR: C:\Python38-x64

# Configure the GitHub username and email for accessing the `pygls` release
init:
- git config --global user.name %OLL_GIT_USER_NAME%
- git config --global user.email %OLL_GIT_EMAIL%

# Install scripts. (runs after repo cloning)
install:
- C:\Python35-x64\python.exe -m pip install --upgrade pip # upgrade pip
- python -m pip install tox

# point to the same version as in `examples/json-extension/package.json`
- npm install -g [email protected]
- tsc --version

# install vsce module (for packaging our extension into a .vsix file)
- npm install -g [email protected]

# Output useful info for debugging.
- node --version
- npm --version

# Create a Visual Studio Code Extension
build_script:
# Create a Visual Studio Code Extension (only on windows for now)
- ps: >-
$json_extension_client_json = (Get-Content -Raw -Path examples\json-extension\package.json | ConvertFrom-Json);
$prefixed_version = "v" + $json_extension_client_json.version;
Expand Down Expand Up @@ -86,39 +131,19 @@ install:
}
echo "APPVEYOR_BUILD_VERSION - $env:APPVEYOR_BUILD_VERSION";
# install pygls and dev dependencies
- C:\Python35-x64\Scripts\pip.exe install .[dev]
- C:\Python35-x64\Scripts\pip.exe install .[test]
- C:\Python35-x64\Scripts\pip.exe install -e .

# point to the same version as in `examples/json-extension/package.json`
- npm install -g [email protected]
- tsc --version

# install vsce module (for packaging our extension into a .vsix file)
- npm install -g [email protected]

# Output useful info for debugging.
- node --version
- npm --version

# Create a Visual Studio Code Extension
build_script:
- cd examples\json-extension
- cd examples/json-extension
# install extension-wide js dependencies
- npm install --save-dev
# run tslint
- .\node_modules\.bin\tslint client\src\*.ts
- ./node_modules/.bin/tslint client/src/*.ts
# install our dependencies
- npm install # TODO: replace with `yarn install`
- npm install # TODO: replace with `yarn install`
- tsc -p .

- cd ..\..\
- cd ../../

test_script:
- C:\Python35-x64\Scripts\flake8.exe
- C:\Python35-x64\Scripts\bandit.exe -r ./pygls
- C:\Python35-x64\Scripts\pytest.exe
- python --version
- python -m tox

after_test:
# check function
Expand All @@ -132,9 +157,9 @@ after_test:
}
# package up the json-extension client example VS Code extension
- ps: cd examples/json-extension/
- cd examples/json-extension/
# check to see if key files will be in the `.vsix` package to be built
- vsce ls > packages.txt rem list files to be packaged
- vsce ls > packages.txt
# files/folders to be checked
- ps: CheckInVsixPackage "package.json"
- ps: CheckInVsixPackage "out/extension.js"
Expand All @@ -143,11 +168,10 @@ after_test:
- ps: CheckInVsixPackage "server/server.py"
# clean-up after ourselves (so these files don't end up in our `.vsix` package)
- rm packages.txt
- rm results.txt
- ps: rm results.txt
# passed the basic checks, should be good-to-go
- vsce package rem "normal" command line is on purpose

- ps: cd ../
- vsce package
- cd ..

# Create extensions artifacts
artifacts:
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[flake8]
max-line-length = 99

[mypy]
ignore_missing_imports = True
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
development = [
"bandit==1.6.0", # Run locally: bandit -r ./pygls
"flake8==3.7.7", # Run locally: flake8
"mypy==0.761", # Run locally: mypy .
]

docs_require = [
Expand Down
13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.

0 comments on commit adcc10d

Please sign in to comment.