Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Build and Test installation #60

Build and Test installation

Build and Test installation #60

Workflow file for this run

name: Build and Test installation
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build python${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
- name: Build wheel
run: |
poetry build
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels-py${{ matrix.python-version }}
path: ./dist/
build-and-test:
name: Test on ${{ matrix.os }}-py${{ matrix.python-version }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.9, '3.10', 3.11]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: wheels-py${{ matrix.python-version }}
path: ./dist/
- name: Install dev dependencies
run: |
poetry install --no-root --only dev --no-interaction
- name: Install the wheel
run: |
source $VENV
pip install dist/pinecone_canopy*.whl
- name: Debug print canopy
run: |
source $VENV
python -c "import canopy; print(canopy.__file__)"
- name: Run unit tests
run: |
source $VENV
pytest --html=report.html --self-contained-html tests/unit
- name: Upload pytest reports
if: always()
uses: actions/upload-artifact@v3
with:
name: pytest-report-${{ matrix.os }}-py${{ matrix.python-version }}
path: .pytest_cache