Skip to content

Commit

Permalink
feat: build package files and test the installation on various system…
Browse files Browse the repository at this point in the history
…s/version
  • Loading branch information
pbordron committed Mar 20, 2024
1 parent 17aae01 commit aa37392
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--action-offline-mode
--artifact-server-path ./artifacts
56 changes: 56 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ docs/_build
docs/javascript
venv
.venv
node_modules
node_modules
artifacts

0 comments on commit aa37392

Please sign in to comment.