@@ -201,6 +201,83 @@ jobs:
201201 run : |
202202 tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy
203203
204+ build_test_release_artifact :
205+ name : Build and Test Release Artifact
206+ runs-on : ubuntu-latest
207+
208+ strategy :
209+ matrix :
210+ python_version : [3.8]
211+
212+ steps :
213+ - uses : actions/checkout@master
214+ with :
215+ fetch-depth : 1
216+
217+ - name : Use Python ${{ matrix.python_version }}
218+ uses : actions/setup-python@v5
219+ with :
220+ python-version : ${{ matrix.python_version }}
221+
222+ - name : Cache Python Dependencies
223+ uses : actions/cache@v4
224+ with :
225+ path : ~/.cache/pip
226+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements-lint.txt') }}
227+ restore-keys : |
228+ ${{ runner.os }}-pip-
229+
230+ - name : Install Python Dependencies
231+ run : |
232+ pip install -r requirements-ci.txt
233+ pip install -e ".[build]"
234+
235+ - name : Build Release Artifact
236+ run : |
237+ pip list installed
238+ python -m build -vv
239+
240+ - name : Set Environment
241+ run : |
242+ export PYTHONPATH=.
243+ export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)")
244+ echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
245+
246+ - name : Verify Tarball Release Artifact
247+ run : |
248+ # Verify tarball file exists
249+ export TARBALL_FILENAME="apache_libcloud-${VERSION}.tar.gz"
250+
251+ ls -la "dist/${TARBALL_FILENAME}"
252+
253+ cd dist/
254+
255+ # Unpack tarball and verify + run the tests
256+ tar -xzvf "${TARBALL_FILENAME}"
257+
258+ cd "apache_libcloud-${VERSION}/"
259+ tox -epy3.8
260+
261+ - name : Verify Wheel Release Artifact
262+ run : |
263+ # Verify wheel file exists
264+ export WHEEL_FILENAME="apache_libcloud-${VERSION}-py2.py3-none-any.whl"
265+
266+ ls -la "dist/${WHEEL_FILENAME}"
267+
268+ cd dist/
269+
270+ # Unpack wheel and verify + run tests
271+ unzip "${WHEEL_FILENAME}" -d "wheel"
272+ cd wheel
273+
274+ # Since wheel doesn't include those files, we need to manually copy them over from
275+ # repo root so we can run the tests
276+ cp ../../tox.ini .
277+ cp ../../requirements-tests.txt .
278+ cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py
279+ tox -epy3.8
280+
204281 build_test_docker_image :
205282 name : Build and Verify Docker Image
206283 runs-on : ubuntu-latest
0 commit comments