Skip to content

Commit

Permalink
update ci and fix openai version
Browse files Browse the repository at this point in the history
Signed-off-by: Fotis Nikolaidis <[email protected]>
  • Loading branch information
fnikolai committed Nov 7, 2023
1 parent 761e004 commit e8797d7
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 9 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/cache-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Update Cache
on:
push:
branches:
- main
paths: # run this action only when the docs folder is changed
- 'pyproject.toml'
workflow_dispatch: # allows triggering a GitHub action manually - see 'Actions' tab


# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true


jobs:
#---------------------------------------------------
# Cache Builder
#---------------------------------------------------
cache-builder:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ] # TODO: add "windows-latest", "macos-latest" when Docker removed
python-version: ["3.8", "3.11"] # Due to cache limitations, check only the earliest and the latest.

steps:
- name: Check out repository
uses: actions/checkout@v3

#---------------------------------------------------
# Configuring Python environments.
#
# We intentionally commented the `cache` field to remind us not to enable it.
# The reason is that most of the time is spent on package installation rather than package downloading.
# As a result, in the next step, we will cache the complete Python environment, including all pre-installed components.
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
#cache: 'pip' # Do not activate

- name: Cache Python ${{ matrix.python-version }}
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}_python-${{ matrix.python-version }}_${{ hashFiles('**/pyproject.toml') }}
#---------------------------------------------------

- name: Install Dev Dependencies
run: python -m pip install --upgrade .[dev]
4 changes: 2 additions & 2 deletions .github/workflows/ci_code.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate code changes
name: Code Testing

on: # rules for when this action will be triggered
pull_request:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}_python-${{ matrix.python-version }}_${{ hashFiles('pyproject.toml') }}
key: ${{ matrix.os }}_python-${{ matrix.python-version }}_${{ hashFiles('**/pyproject.toml') }}
#---------------------------------------------------

- name: Install Dependencies
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci_docs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Doc Changes
name: Build Doc Website
on:
push:
branches:
Expand Down Expand Up @@ -27,26 +27,25 @@ jobs:
sudo apt-get update
sudo apt-get install nodejs npm
- name: Set up Python 3.10
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Cache pip packages
uses: actions/cache@v3
with:
path: |
${{ env.pythonLocation }}
key: python3.10_ubuntu-latest_${{ hashFiles('**/pyproject.toml') }}
key: ubuntu-latest_python-3.11_${{ hashFiles('**/pyproject.toml') }}

- name: Build docs and use-cases
# build is available in docs/hr/build
run: |
make hr-docs
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[docs]

- name: Build inline api docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release new version
name: Release in Pypi/DockerHub
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ torch = [
"torchvision",
]
apis = [
"openai>=0.27.6",
"openai==0.27.6",
"cohere",
"anthropic",
]
Expand Down

0 comments on commit e8797d7

Please sign in to comment.