Skip to content

Commit 32eaf7b

Browse files
authored
Check that the package build works (#485)
1 parent 402d66a commit 32eaf7b

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/push.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,67 @@ jobs:
5858
uses: codecov/codecov-action@v2
5959
with:
6060
env_vars: OS,PYTHON_VERSION
61+
62+
build:
63+
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
python-version:
67+
- '2.7'
68+
- '3.6'
69+
env:
70+
PYTHON_VERSION: ${{ matrix.python-version }}
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v2
74+
75+
- name: Set up Python ${{ matrix.python-version }}
76+
uses: actions/setup-python@v1
77+
with:
78+
python-version: ${{ matrix.python-version }}
79+
80+
- name: Install pip
81+
run: pip install --upgrade pip
82+
83+
- name: Install dependencies
84+
run: |
85+
pip install wheel
86+
87+
- name: Build distribution files
88+
id: build-dist
89+
run: |
90+
# Build distribution files
91+
python setup.py sdist bdist_wheel
92+
93+
# List distribution files and check their file sizes
94+
ls -lh dist
95+
96+
# Set step outputs
97+
sdist_path=$(find dist -type f -name "*.tar.gz")
98+
wheel_path=$(find dist -type f -name "*.whl")
99+
wheel_name=$(basename $wheel_path)
100+
wheel_size=$(stat -c %s $wheel_path)
101+
echo "::set-output name=sdist-path::${sdist_path}"
102+
echo "::set-output name=wheel-path::${wheel_path}"
103+
echo "::set-output name=wheel-name::${wheel_name}"
104+
echo "::set-output name=wheel-size::${wheel_size}"
105+
106+
- name: Test installation from tarball
107+
run: |
108+
set -x
109+
pip install ${{ steps.build-dist.outputs.sdist-path }}
110+
python -c "import databricks_cli.version; print(databricks_cli.version.version)"
111+
which databricks
112+
databricks --version
113+
which dbfs
114+
dbfs --version
115+
116+
- name: Test installation from wheel
117+
run: |
118+
set -x
119+
pip install --force-reinstall ${{ steps.build-dist.outputs.wheel-path }}
120+
python -c "import databricks_cli.version; print(databricks_cli.version.version)"
121+
which databricks
122+
databricks --version
123+
which dbfs
124+
dbfs --version

0 commit comments

Comments
 (0)