Skip to content

Builds for Python 3.6 no longer work; disable them #454

Builds for Python 3.6 no longer work; disable them

Builds for Python 3.6 no longer work; disable them #454

Workflow file for this run

name: Test
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
os: [ ubuntu-20.04 ]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: pip install --upgrade pip
- name: Install development dependencies (Python 2)
if: ${{ startsWith(matrix.python-version, '2.') }}
run: pip install --upgrade -r dev-requirements-py2.txt
- name: Install development dependencies (Python 3)
if: ${{ startsWith(matrix.python-version, '3.') }}
run: pip install --upgrade -r dev-requirements-py3.txt
- name: Log package versions
run: pip freeze
- name: Run tests
run: pytest tests --cov=./
- name: Run lint
run: prospector --profile ./prospector.yaml -t dodgy -t mccabe -t profile-validator -t pyflakes -t pylint
- name: Run rstcheck
run: rstcheck README.rst
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: OS,PYTHON_VERSION
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- '3.7'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: pip install --upgrade pip
- name: Install dependencies
run: |
pip install wheel
- name: Build distribution files
id: build-dist
run: |
# Build distribution files
python setup.py sdist bdist_wheel
# List distribution files and check their file sizes
ls -lh dist
# Set step outputs
sdist_path=$(find dist -type f -name "*.tar.gz")
wheel_path=$(find dist -type f -name "*.whl")
wheel_name=$(basename $wheel_path)
wheel_size=$(stat -c %s $wheel_path)
echo "::set-output name=sdist-path::${sdist_path}"
echo "::set-output name=wheel-path::${wheel_path}"
echo "::set-output name=wheel-name::${wheel_name}"
echo "::set-output name=wheel-size::${wheel_size}"
- name: Test installation from tarball
run: |
set -x
pip install ${{ steps.build-dist.outputs.sdist-path }}
python -c "import databricks_cli.version; print(databricks_cli.version.version)"
which databricks
databricks --version
which dbfs
dbfs --version
- name: Test installation from wheel
run: |
set -x
pip install --force-reinstall ${{ steps.build-dist.outputs.wheel-path }}
python -c "import databricks_cli.version; print(databricks_cli.version.version)"
which databricks
databricks --version
which dbfs
dbfs --version
compat:
name: Public API compatibility
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
path: databricks-cli-main
- name: Set up Python
uses: actions/setup-python@v1
- name: Install pip
run: pip install --upgrade pip
- name: Install development dependencies (Python 3)
run: pip install --upgrade -r dev-requirements-py3.txt
- name: Run compatibility test
run: |
export DATABRICKS_CLI_MAIN_CHECKOUT=$GITHUB_WORKSPACE/databricks-cli-main
pytest --capture=no tests/test_compat.py