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

Commit

Permalink
[CI] Single build, multiple test
Browse files Browse the repository at this point in the history
No need to build separately on each OS, since it's pure python code
  • Loading branch information
igiloh-pinecone committed Oct 31, 2023
1 parent 67e13bf commit 531b2e5
Showing 1 changed file with 45 additions and 11 deletions.
56 changes: 45 additions & 11 deletions .github/workflows/pre-release-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,40 @@ concurrency:
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: Build & Test on ${{ matrix.os }}-py${{ matrix.python-version }}
name: Test on ${{ matrix.os }}-py${{ matrix.python-version }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -31,27 +63,29 @@ jobs:
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: false
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Build wheel
run: |
poetry build
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: wheels-py${{ matrix.python-version }}
path: ./dist/

- name: Install the wheel
run: |
source $VENV
pip install dist/pinecone_canopy*.whl
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
path: ./dist/

- name: Install dev dependencies
run: |
poetry install --no-root --only dev --no-interaction
- name: Debug print canopy
run: |
python -c "import canopy; print(canopy.__file__)"
- name: Run unit tests
run: pytest --html=report.html --self-contained-html tests/unit

Expand Down

0 comments on commit 531b2e5

Please sign in to comment.