DX-1264: Update Exports & Add CI Tests #408
Workflow file for this run
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
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" # daily | |
env: | |
UPSTASH_VECTOR_REST_URL: ${{ secrets.UPSTASH_VECTOR_REST_URL }} | |
UPSTASH_VECTOR_REST_TOKEN: ${{ secrets.UPSTASH_VECTOR_REST_TOKEN }} | |
UPSTASH_REDIS_REST_URL: ${{secrets.UPSTASH_REDIS_REST_URL}} | |
UPSTASH_REDIS_REST_TOKEN: ${{secrets.UPSTASH_REDIS_REST_TOKEN}} | |
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} | |
QSTASH_TOKEN: ${{secrets.QSTASH_TOKEN}} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
concurrency: test | |
name: Tests | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Run Lint | |
run: bun run fmt | |
- name: Run tests | |
run: bun run test | |
- name: Run Build | |
run: bun run build | |
cloudflare-workers-local: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Install example | |
run: bun add @upstash/rag-chat@../../dist | |
working-directory: examples/cloudflare-workers | |
- name: Add environment | |
run: | | |
echo '[vars]' >> wrangler.toml | |
echo "UPSTASH_VECTOR_REST_URL = \"$UPSTASH_VECTOR_REST_URL\"" >> ./wrangler.toml | |
echo "UPSTASH_VECTOR_REST_TOKEN = \"$UPSTASH_VECTOR_REST_TOKEN\"" >> ./wrangler.toml | |
echo "UPSTASH_REDIS_REST_URL = \"$UPSTASH_REDIS_REST_URL\"" >> ./wrangler.toml | |
echo "UPSTASH_REDIS_REST_TOKEN = \"$UPSTASH_REDIS_REST_TOKEN\"" >> ./wrangler.toml | |
echo "QSTASH_TOKEN = \"$QSTASH_TOKEN\"" >> ./wrangler.toml | |
working-directory: examples/cloudflare-workers | |
- name: Start example | |
run: bun dev & | |
working-directory: examples/cloudflare-workers | |
- name: Test | |
run: bun test ci.test.ts | |
working-directory: examples/cloudflare-workers | |
nodejs-local: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Install example | |
run: bun add @upstash/rag-chat@../../dist | |
working-directory: examples/nodejs | |
- name: Run example | |
run: npm run dev & | |
working-directory: examples/nodejs | |
- name: Test | |
run: bun test ci.test.ts | |
working-directory: examples/nodejs | |
nextjs-chat-to-website: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Install example | |
run: bun add @upstash/rag-chat@../../../dist | |
working-directory: examples/nextjs/chat-to-website | |
- name: Run example | |
run: npm run dev & | |
working-directory: examples/nextjs/chat-to-website | |
- name: Test | |
run: bun test ci.test.ts | |
working-directory: examples/nextjs/chat-to-website | |
nextjs-server-actions: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Install example | |
run: bun add @upstash/rag-chat@../../../dist | |
working-directory: examples/nextjs/server-actions | |
- name: Run example | |
run: npm run dev & | |
working-directory: examples/nextjs/server-actions | |
- name: Test | |
run: bun test ci.test.ts | |
working-directory: examples/nextjs/server-actions | |
nextjs-vercel-ai-sdk: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install Dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Install example | |
run: bun add @upstash/rag-chat@../../../dist | |
working-directory: examples/nextjs/vercel-ai-sdk | |
- name: Run example | |
run: npm run dev & | |
working-directory: examples/nextjs/vercel-ai-sdk | |
- name: Test | |
run: bun test ci.test.ts | |
working-directory: examples/nextjs/vercel-ai-sdk |