feat: build package files and test the installation on various system… #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Python 🐍 distribution 📦 and test its installation | |
on: push | |
jobs: | |
build: | |
name: Build distribution 📦 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- name: Install pypa/build | |
run: | | |
python3 -m pip install --upgrade pip setuptools wheel | |
python3 -m pip install build --user | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
test-install: | |
name: >- | |
Test Python 🐍 package installation | |
needs: | |
- build | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
os: ['ubuntu-latest', 'macos-latest'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Install dgenies from wheel | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python3 -m pip install dist/dgenies*.whl | |
- name: Test dgenies | |
run: dgenies --help | |
- name: Test dgenies import | |
run: python -c 'import dgenies; import dgenies.lib' |