Skip to content

Commit

Permalink
Merge branch 'main' into svgtofont
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan authored Nov 2, 2024
2 parents 7134716 + 6d0f342 commit 49d8f12
Show file tree
Hide file tree
Showing 698 changed files with 47,607 additions and 57,176 deletions.
3 changes: 3 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.genaiscript/
node_modules/
built/
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"astro-build.astro-vscode",
"unifiedjs.vscode-mdx",
"streetsidesoftware.code-spell-checker",
"file-icons.file-icons"
"file-icons.file-icons",
"GitHub.vscode-pull-request-github",
"johnpapa.vscode-peacock",
"usernamehw.errorlens",
"goessner.mdmath"
]
}
},
Expand Down
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
.env
slides/
graphics/
temp/
.genaiscript/
.github/
.vscode/
demo/
packages/samples/
51 changes: 51 additions & 0 deletions .github/workflows/build-genai-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: genai commit tests

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
push:
branches: [main]
paths:
- "packages/core/**"
- "packages/sample/**"
- "packages/cli/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- name: typecheck
run: yarn typecheck
- name: compile
run: yarn compile
- name: download ollama docker
run: docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
- name: generate dummy result
working-directory: packages/sample
run: mkdir -p temp && touch temp/commit-tests.txt
- name: select llm tests to run
run: node packages/cli/built/genaiscript.cjs run test-commit --out-trace $GITHUB_STEP_SUMMARY --model azure_serverless:gpt-4o --small-model azure_serverless:gpt-4o-mini
env:
AZURE_SERVERLESS_OPENAI_API_ENDPOINT: ${{ secrets.AZURE_SERVERLESS_OPENAI_API_ENDPOINT }}
AZURE_SERVERLESS_OPENAI_API_KEY: ${{ secrets.AZURE_SERVERLESS_OPENAI_API_KEY }}
- name: run llm tests
working-directory: packages/sample
run: xargs -r -a temp/commit-tests.txt node ../cli/built/genaiscript.cjs test --out-summary $GITHUB_STEP_SUMMARY --test-delay 10 --model azure_serverless:gpt-4o --small-model azure_serverless:gpt-4o-mini
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AZURE_SERVERLESS_OPENAI_API_ENDPOINT: ${{ secrets.AZURE_SERVERLESS_OPENAI_API_ENDPOINT }}
AZURE_SERVERLESS_OPENAI_API_KEY: ${{ secrets.AZURE_SERVERLESS_OPENAI_API_KEY }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}

22 changes: 1 addition & 21 deletions .github/workflows/build-genai.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: build genai tests
name: genai tests

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
push:
branches: [main]
paths:
- "packages/core/**"
- "packages/sample/**"
- "packages/cli/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -40,17 +34,3 @@ jobs:
run: docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
- name: run test within scripts
run: yarn test:scripts --out-summary $GITHUB_STEP_SUMMARY --test-delay 10
- name: Add comment to PR
uses: actions/github-script@v5
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
import { readFile } from 'fs/promises';
const comment = await readFile('packages/sample/summary.txt', 'utf8');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
})
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
run: yarn typecheck
- name: compile
run: yarn compile
- name: lint
run: yarn lint
- name: package vscode
run: yarn package
- name: compile system scripts
run: yarn test:system
- name: compile tests
Expand All @@ -33,7 +37,3 @@ jobs:
run: yarn test:core
- name: unit tests
run: yarn test:samples
- name: docs
run: yarn build:docs
- name: package vscode
run: yarn package
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ jobs:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn playwright install
- name: Typecheck
run: yarn typecheck
- name: Compile
run: yarn compile
- name: Build slides
run: yarn build:slides
- name: Build docs
run: yarn build:docs
- name: no jekyll
run: touch docs/dist/.nojekyll
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@v4.6.4
with:
folder: docs/dist
single-commit: true
2 changes: 1 addition & 1 deletion .github/workflows/genai-alt-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: compile
run: yarn compile
- name: alt text
run: yarn genai:alt
run: yarn genai:alt --out-trace $GITHUB_STEP_SUMMARY
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/genai-azure-service-principal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: az login with service principal
on:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Azure Login action
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- name: typecheck
run: yarn typecheck
- name: compile
run: yarn compile
- name: run script with azure deployment
run: node packages/cli/built/genaiscript.cjs run poem --model azure:gpt-4-turbo --out-trace $GITHUB_STEP_SUMMARY
env:
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
40 changes: 40 additions & 0 deletions .github/workflows/genai-blog-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: genai blog post generator
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 10
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- name: compile
run: yarn compile
- name: generate blog post
run: yarn genai:blog-post --out-trace $GITHUB_STEP_SUMMARY
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
- name: docs
run: yarn build:docs
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "docs/src/content/docs/blog/drafts/*.md"
commit_message: "[genai] generated blog posts"
commit_user_name: "genaiscript"
2 changes: 1 addition & 1 deletion .github/workflows/genai-commander.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: resolve pr sha
id: sha
uses: actions/github-script@v4
uses: actions/github-script@v7
with:
result-encoding: string
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/genai-frontmatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: compile
run: yarn compile
- name: front matter
run: yarn genai:frontmatter
run: yarn genai:frontmatter --out-trace $GITHUB_STEP_SUMMARY
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/genai-investigator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: genai investigator
on:
workflow_run:
workflows: ["build", "playwright", "ollama"]
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.workflow_run.event }}-${{ github.event.workflow_run.conclusion }}
cancel-in-progress: true
permissions:
contents: read
actions: read
pull-requests: write
jobs:
investigate:
# Only run this job if the workflow run concluded with a failure
# and was triggered by a pull request event
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 10
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- name: compile
run: yarn compile
- name: genaiscript gai
run: node packages/cli/built/genaiscript.cjs run gai -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }}
- name: genaiscript github-agent
run: node packages/cli/built/genaiscript.cjs run github-agent -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }}
- name: genaiscript github-one
run: node packages/cli/built/genaiscript.cjs run github-one -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }}
1 change: 1 addition & 0 deletions .github/workflows/genai-pr-commit-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: git fetch origin && git pull origin main:main
- name: genaiscript pr-review-commit
run: node packages/cli/built/genaiscript.cjs run pr-review-commit --out ./temp/genai/pr-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMIT_SHA: ${{ github.event.pull_request.head.sha}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/genai-pr-docs-commit-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run: git fetch origin && git pull origin main:main
- name: genaiscript pr-review-commit
run: node packages/cli/built/genaiscript.cjs run pr-docs-review-commit --out ./temp/genai/pr-docs-review-commit -prr --out-trace $GITHUB_STEP_SUMMARY
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMIT_SHA: ${{ github.event.pull_request.head.sha}}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/genai-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: git stuff
run: git fetch origin && git pull origin main:main
- name: genaiscript pr-describe
continue-on-error: true
run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -39,6 +40,7 @@ jobs:
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
- name: genaiscript pr-review
run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc --out-trace $GITHUB_STEP_SUMMARY
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMIT_SHA: ${{ github.event.pull_request.base.sha}}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/large_runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Read and Echo Files

on:
workflow_dispatch:

jobs:
read_and_echo:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read and echo files
run: |
for file in $(ls | head -n 10); do
echo "Contents of $file:"
cat "$file"
echo ""
done
1 change: 1 addition & 0 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
node-version: "20"
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn compile
- run: yarn gen:licenses
- uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
cache: yarn
- run: yarn install
- run: yarn compile
- run: yarn publish
working-directory: packages/cli
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 49d8f12

Please sign in to comment.