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

Temp/try merge queue3 #118

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Run unit tests and linters

on: pull_request

# Cancel previous runs on the same branch \ PR number if they are still running
# From: https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
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
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with dev
- name: Install project
run: poetry install --no-interaction
- name: Run flake8 Check
run: poetry run flake8 .
- name: Run mypy check
run: poetry run mypy src

run-tests:
name: Run tests
runs-on: ubuntu-latest
needs: run-linters
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]
pinecone-plan: ["paid", "starter"]

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
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with dev
- name: Install project
run: poetry install --no-interaction
- name: Run unit tests
run: poetry run pytest --html=report.html --self-contained-html tests/unit
- name: upload pytest report.html
uses: actions/upload-artifact@v3
if: always()
with:
name: pytest-report-py${{ matrix.python-version }}-${{ matrix.pinecone-plan }}
path: report*.html
48 changes: 2 additions & 46 deletions .github/workflows/CI.yml → .github/workflows/merege_queue.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI
name: Run system and e2e tests

on: pull_request
on: merge_group

# Cancel previous runs on the same branch \ PR number if they are still running
# From: https://stackoverflow.com/a/72408109
Expand All @@ -10,48 +10,6 @@ concurrency:


jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
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
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with dev
- name: Install project
run: poetry install --no-interaction
- name: Run flake8 Check
run: poetry run flake8 .
- name: Run mypy check
run: poetry run mypy src

run-tests:
name: Run tests
Expand Down Expand Up @@ -93,8 +51,6 @@ jobs:
run: poetry install --no-interaction --no-root --with dev
- name: Install project
run: poetry install --no-interaction
- name: Run unit tests
run: poetry run pytest --html=report.html --self-contained-html tests/unit
- name: Set Index Name for System / E2E
id: gen_suffix
run: |
Expand Down