Try to add Github Actions

This commit is contained in:
Dave Halter
2020-12-26 01:03:03 +01:00
parent 8740ff2691
commit 239a3730a6
2 changed files with 70 additions and 1 deletions

67
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
on: push
jobs:
tests:
# Set the type of machine to run on
runs-on: [ubuntu-20.04, windows-2019]
strategy:
matrix:
environment: ['3.8', '3.9', '3.7', '3.6', 'interpreter']
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: 'pip install .[testing]'
- uses: actions/setup-python@v2
if: ${{ matrix.environment != 'interpreter' }}
with:
python-version: ${{ matrix.interpreter }}
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run tests
run: pytest
env:
JEDI_TEST_ENVIRONMENT: ${{ matrix.environment }}
code-quality:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: 'pip install .[qa]'
- name: Run tests
run: |
flake8 jedi setup.py
mypy jedi sith.py'
coverage:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: 'pip install .[testing] coverage'
- name: Run tests
run: |
coverage run --source jedi -m pytest
coverage report
- name: Upload coverage data
run: |
pip install --quiet codecov coveralls
coverage xml
coverage report -m
coveralls
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X search -X fix -X xcode -f coverage.xml

View File

@@ -100,7 +100,9 @@ def environment(request):
if request.config.option.interpreter_env or version == 'interpreter':
return InterpreterEnvironment()
return get_system_environment(version[0] + '.' + version[1:])
if '.' not in version:
version = version[0] + '.' + version[1:]
return get_system_environment(version)
@pytest.fixture(scope='session')