Skip to content

Commit bee6d47

Browse files
Standardize GH actions workflows (#262)
This PR standardizes the CI/CD flow within github actions -- following along with the team documentation [here](https://redislabs.atlassian.net/wiki/spaces/FE/pages/4913201472/GitHub+CICD+Release+Workflows) and implemented already on the [redis-model-store](https://github.com/redis-applied-ai/redis-model-store) project.
1 parent 0dff967 commit bee6d47

File tree

3 files changed

+16
-91
lines changed

3 files changed

+16
-91
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
branches:
88
- main
99

10+
env:
11+
POETRY_VERSION: "1.8.3"
12+
1013
jobs:
1114
check:
1215
name: Style-check ${{ matrix.python-version }}
@@ -33,7 +36,7 @@ jobs:
3336
- name: Install Poetry
3437
uses: snok/install-poetry@v1
3538
with:
36-
version: 1.8.3
39+
version: ${{ env.POETRY_VERSION }}
3740
- name: Install dependencies
3841
run: |
3942
poetry install --all-extras

.github/workflows/release.yml

Lines changed: 8 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Release
1+
name: Publish Release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: 'Version of this deployment'
8-
required: true
4+
release:
5+
types: [published]
96

107
env:
118
PYTHON_VERSION: "3.11"
@@ -26,10 +23,7 @@ jobs:
2623
- name: Install Poetry
2724
uses: snok/install-poetry@v1
2825
with:
29-
version: 1.8.3
30-
31-
- name: Set Version
32-
run: poetry version ${{ github.event.inputs.version }}
26+
version: ${{ env.POETRY_VERSION }}
3327

3428
- name: Build package
3529
run: poetry build
@@ -40,56 +34,8 @@ jobs:
4034
name: dist
4135
path: dist/
4236

43-
# test-pypi-publish:
44-
# needs: build
45-
# runs-on: ubuntu-latest
46-
47-
# steps:
48-
# - uses: actions/checkout@v4
49-
50-
# - name: Set up Python
51-
# uses: actions/setup-python@v4
52-
# with:
53-
# python-version: ${{ env.PYTHON_VERSION }}
54-
55-
# - name: Install Poetry
56-
# uses: snok/install-poetry@v1
57-
58-
# - uses: actions/download-artifact@v4
59-
# with:
60-
# name: dist
61-
# path: dist/
62-
63-
# - name: Publish to TestPyPI
64-
# env:
65-
# POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }}
66-
# 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
67-
68-
# pre-release-checks:
69-
# needs: test-pypi-publish
70-
# runs-on: ubuntu-latest
71-
72-
# steps:
73-
# - uses: actions/checkout@v4
74-
75-
# - name: Set up Python
76-
# uses: actions/setup-python@v4
77-
# with:
78-
# python-version: ${{ env.PYTHON_VERSION }}
79-
80-
# - name: Install Poetry
81-
# uses: snok/install-poetry@v1
82-
83-
# - name: Install dependencies
84-
# run: |
85-
# poetry install --all-extras
86-
87-
# - name: Install published package from TestPyPI
88-
# run:
89-
# poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl; SKIP_VECTORIZERS=True SKIP_RERANKERS=True poetry run test-cov
90-
9137
publish:
92-
needs: build #pre-release-checks
38+
needs: build
9339
runs-on: ubuntu-latest
9440

9541
steps:
@@ -102,6 +48,8 @@ jobs:
10248

10349
- name: Install Poetry
10450
uses: snok/install-poetry@v1
51+
with:
52+
version: ${{ env.POETRY_VERSION }}
10553

10654
- uses: actions/download-artifact@v4
10755
with:
@@ -111,26 +59,4 @@ jobs:
11159
- name: Publish to PyPI
11260
env:
11361
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
114-
run: poetry publish
115-
116-
create-release:
117-
needs: publish
118-
runs-on: ubuntu-latest
119-
120-
steps:
121-
- uses: actions/checkout@v4
122-
123-
- uses: actions/download-artifact@v4
124-
with:
125-
name: dist
126-
path: dist/
127-
128-
- name: Create Release
129-
uses: ncipollo/release-action@v1
130-
with:
131-
artifacts: "dist/*"
132-
token: ${{ secrets.GITHUB_TOKEN }}
133-
draft: false
134-
generateReleaseNotes: true
135-
tag: ${{ github.event.inputs.version }}
136-
commit: main
62+
run: poetry publish

.github/workflows/run_tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
branches:
88
- main
99

10+
env:
11+
POETRY_VERSION: "1.8.3"
12+
1013
jobs:
1114
test:
1215
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis-stack ${{matrix.redis-stack-version}}]
@@ -36,7 +39,7 @@ jobs:
3639
- name: Install Poetry
3740
uses: snok/install-poetry@v1
3841
with:
39-
version: 1.8.3
42+
version: ${{ env.POETRY_VERSION }}
4043

4144
- name: Install dependencies
4245
run: |
@@ -96,10 +99,3 @@ jobs:
9699
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
97100
run: |
98101
cd docs/ && poetry run treon -v
99-
100-
- name: Publish coverage results
101-
uses: codecov/codecov-action@v4
102-
with:
103-
token: ${{ secrets.CODECOV_TOKEN }}
104-
files: ./coverage.xml
105-
fail_ci_if_error: false

0 commit comments

Comments
 (0)