Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
add push branch
  • Loading branch information
rbs333 authored and tylerhutcherson committed May 1, 2024
1 parent 37a1826 commit 16049f0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Release

on:
# TODO: remove
push:
branches: [ robert/build/tests ]
workflow_dispatch:
inputs:
version:
Expand All @@ -13,7 +16,7 @@ env:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -40,7 +43,7 @@ jobs:

test-pypi-publish:
needs: build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -59,15 +62,13 @@ jobs:
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }}
run: poetry config repositories.test-pypi https://test.pypi.org/legacy/; poetry config pypi-token.test-pypi $POETRY_PYPI_TOKEN_TESTPYPI; poetry publish --repository test-pypi

pre-release-checks:
needs: test-pypi-publish
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -80,13 +81,10 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: |
poetry install --all-extras
# - name: Install dependencies
# run: |
# poetry install --all-extras
- name: Install published package from TestPyPI
run: |
poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl==${{ github.event.inputs.version }}
- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
Expand All @@ -96,11 +94,12 @@ jobs:
AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
run: |
poetry run test-cov
run:
poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl-test; poetry run test-cov

# publish:
# needs: pre-release-checks
# runs-on: ubuntu-22.04
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4
Expand All @@ -118,14 +117,14 @@ jobs:
# name: dist
# path: dist/

# - name: Publish to PyPI
# env:
# POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
# run: poetry publish
# - name: Publish to PyPI
# env:
# POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
# run: poetry publish

# create-release:
# needs: publish
# runs-on: ubuntu-22.04
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ scratch
wiki_schema.yaml
docs/_build/
.venv
coverage.xml
coverage.xml
dist/
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisvl"
version = "0.1.3"
name = "redisvl-test"
version = "0.1.3.9"
description = "Python client library and CLI for using Redis as a vector database"
authors = ["Redis Inc. <applied.ai@redis.com>"]
license = "MIT"
Expand Down
24 changes: 12 additions & 12 deletions scripts.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import subprocess

def format():
subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"])
subprocess.run(["black", "./redisvl", "./tests/"])
subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"], check=True)
subprocess.run(["black", "./redisvl", "./tests/"], check=True)

def check_format():
subprocess.run(["black", "--check", "./redisvl"])
subprocess.run(["black", "--check", "./redisvl"], check=True)

def sort_imports():
subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"])
subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"], check=True)

def check_sort_imports():
subprocess.run(["isort", "./redisvl", "--check-only", "--profile", "black"])
subprocess.run(["isort", "./redisvl", "--check-only", "--profile", "black"], check=True)

def check_lint():
subprocess.run(["pylint", "--rcfile=.pylintrc", "./redisvl"])
subprocess.run(["pylint", "--rcfile=.pylintrc", "./redisvl"], check=True)

def mypy():
subprocess.run(["python", "-m", "mypy", "./redisvl"])
subprocess.run(["python", "-m", "mypy", "./redisvl"], check=True)

def test():
subprocess.run(["python", "-m", "pytest", "--log-level=CRITICAL"])
subprocess.run(["python", "-m", "pytest", "--log-level=CRITICAL"], check=True)

def test_verbose():
subprocess.run(["python", "-m", "pytest", "-vv", "-s", "--log-level=CRITICAL"])
subprocess.run(["python", "-m", "pytest", "-vv", "-s", "--log-level=CRITICAL"], check=True)

def test_cov():
subprocess.run(["python", "-m", "pytest", "-vv", "--cov=./redisvl", "--cov-report=xml", "--log-level=CRITICAL"])
subprocess.run(["python", "-m", "pytest", "-vv", "--cov=./redisvl", "--cov-report=xml", "--log-level=CRITICAL"], check=True)

def cov():
subprocess.run(["coverage", "html"])
subprocess.run(["coverage", "html"], check=True)
print("If data was present, coverage report is in ./htmlcov/index.html")

def test_notebooks():
subprocess.run(["cd", "docs/", "&&", "poetry run treon", "-v"])
subprocess.run(["cd", "docs/", "&&", "poetry run treon", "-v"], check=True)

0 comments on commit 16049f0

Please sign in to comment.