From aa373928ac688c8aba82fef87a3deaf6d916cacd Mon Sep 17 00:00:00 2001 From: Philippe Bordron Date: Wed, 20 Mar 2024 17:27:14 +0100 Subject: [PATCH] feat: build package files and test the installation on various systems/version --- .actrc | 2 + .github/workflows/build-and-test.yml | 56 ++++++++++++++++++++++++++++ .gitignore | 3 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .actrc create mode 100644 .github/workflows/build-and-test.yml diff --git a/.actrc b/.actrc new file mode 100644 index 0000000..850be7e --- /dev/null +++ b/.actrc @@ -0,0 +1,2 @@ +--action-offline-mode +--artifact-server-path ./artifacts \ No newline at end of file diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..7c82d9f --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -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' \ No newline at end of file diff --git a/.gitignore b/.gitignore index a82166f..8391b34 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ docs/_build docs/javascript venv .venv -node_modules \ No newline at end of file +node_modules +artifacts