-
Notifications
You must be signed in to change notification settings - Fork 234
147 lines (120 loc) · 3.82 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Test
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: pip install --upgrade pip
- name: Install development dependencies
run: pip install --upgrade -r dev-requirements.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: PYTHON_VERSION
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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-22.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@v4
- name: Install pip
run: pip install --upgrade pip
- name: Install development dependencies
run: pip install --upgrade -r dev-requirements.txt
- name: Run compatibility test
run: |
export DATABRICKS_CLI_MAIN_CHECKOUT=$GITHUB_WORKSPACE/databricks-cli-main
pytest --capture=no tests/test_compat.py