-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicole White
committed
Oct 20, 2023
1 parent
4178754
commit a7a80be
Showing
25 changed files
with
309 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OPENAI_API_KEY= | ||
AUTOBLOCKS_INGESTION_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
schedule: | ||
# Every day at ~7:17am Chicago time. | ||
# | ||
# Using a non-zero minute offset since GitHub Actions suggests | ||
# running jobs at a random minute to avoid overloading their | ||
# servers. | ||
# | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | ||
- cron: "17 12 * * *" | ||
|
||
jobs: | ||
test-table-of-contents-up-to-date: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Make table of contents | ||
run: node tools/make-toc.js | ||
|
||
- name: Ensure table of contents is up to date | ||
run: | | ||
if [[ -n $(git status --porcelain) ]]; then | ||
echo "::error::The table of contents is out of date. Please run 'node tools/make-toc.js' and commit the changes." | ||
else | ||
echo "Table of contents is up to date!" | ||
fi | ||
test-python: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
project: | ||
- Python/langchain | ||
- Python/openai-manual | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env | ||
echo "AUTOBLOCKS_INGESTION_KEY=${{ secrets.AUTOBLOCKS_INGESTION_KEY }}" >> .env | ||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install poetry | ||
run: curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
- name: Check pyproject.toml & poetry.lock are in sync | ||
run: poetry lock --check | ||
working-directory: ${{ matrix.project }} | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
working-directory: ${{ matrix.project }} | ||
|
||
- name: Run script | ||
run: poetry run python main.py | ||
working-directory: ${{ matrix.project }} | ||
|
||
test-javascript: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
project: | ||
# - JavaScript/chatbot-nextjs | ||
- JavaScript/langchain | ||
# - JavaScript/novel-ai-text-editor | ||
- JavaScript/openai-automated | ||
- JavaScript/openai-manual | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env | ||
echo "AUTOBLOCKS_INGESTION_KEY=${{ secrets.AUTOBLOCKS_INGESTION_KEY }}" >> .env | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
working-directory: ${{ matrix.project }} | ||
|
||
- name: Run script | ||
run: npm run start | ||
working-directory: ${{ matrix.project }} | ||
|
||
notify: | ||
needs: | ||
- test-python | ||
- test-javascript | ||
|
||
if: always() && contains(needs.*.result, 'failure') | ||
# if: always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": ":warning: Workflow `${{ github.workflow }}` in repository `${{ github.repository }}` failed. <${{ env.run-url }}|Logs>" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
run-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
9 changes: 4 additions & 5 deletions
9
JavaScript/openai/package.json → JavaScript/openai-manual/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.