diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..aa46f2f5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/conftest.py b/conftest.py index c6d02216..eeb531c3 100644 --- a/conftest.py +++ b/conftest.py @@ -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')