Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize GH actions workflows #262

Merged
merged 2 commits into from
Jan 24, 2025
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main

env:
POETRY_VERSION: "1.8.3"

jobs:
check:
name: Style-check ${{ matrix.python-version }}
Expand All @@ -33,7 +36,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
run: |
poetry install --all-extras
Expand Down
90 changes: 8 additions & 82 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Release
name: Publish Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version of this deployment'
required: true
release:
types: [published]

env:
PYTHON_VERSION: "3.11"
Expand All @@ -26,10 +23,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3

- name: Set Version
run: poetry version ${{ github.event.inputs.version }}
version: ${{ env.POETRY_VERSION }}

- name: Build package
run: poetry build
Expand All @@ -40,56 +34,8 @@ jobs:
name: dist
path: dist/

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

# steps:
# - uses: actions/checkout@v4

# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}

# - name: Install Poetry
# uses: snok/install-poetry@v1

# - uses: actions/download-artifact@v4
# with:
# name: dist
# path: dist/

# - name: Publish to TestPyPI
# 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-latest

# steps:
# - uses: actions/checkout@v4

# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}

# - name: Install Poetry
# uses: snok/install-poetry@v1

# - 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; SKIP_VECTORIZERS=True SKIP_RERANKERS=True poetry run test-cov

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

steps:
Expand All @@ -102,6 +48,8 @@ jobs:

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- uses: actions/download-artifact@v4
with:
Expand All @@ -111,26 +59,4 @@ jobs:
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
run: poetry publish

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

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
generateReleaseNotes: true
tag: ${{ github.event.inputs.version }}
commit: main
run: poetry publish
12 changes: 4 additions & 8 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main

env:
POETRY_VERSION: "1.8.3"

jobs:
test:
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis-stack ${{matrix.redis-stack-version}}]
Expand Down Expand Up @@ -36,7 +39,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
version: ${{ env.POETRY_VERSION }}

- name: Install dependencies
run: |
Expand Down Expand Up @@ -96,10 +99,3 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd docs/ && poetry run treon -v

- name: Publish coverage results
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
Loading