Skip to content

Commit

Permalink
updating test action (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
roodboi authored Mar 5, 2024
1 parent c205286 commit 3ec74f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Test
on:
pull_request_target:
branches: [ master ]
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-main:
if: github.ref == 'refs/heads/main'
if: github.repository == 'instructor-ai/instructor-js' && github.ref == 'refs/heads/main'
name: run-tests
runs-on: ubuntu-latest
environment: TEST-MAIN
Expand Down Expand Up @@ -39,10 +38,19 @@ jobs:
- run: bun run lint
- run: bun test --timeout=25000

approve:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.

test-branch:
if: github.event_name == 'pull_request'
if: github.ref != 'refs/heads/main'
name: run-tests
runs-on: ubuntu-latest
needs: [approve]
environment: OPENAI
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -52,7 +60,8 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2

- name: Setup bun
uses: oven-sh/setup-bun@v1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ This project is licensed under the terms of the MIT License.
- [ ] Action Item and Dependency Mapping

These translations provide a structured approach to creating TypeScript schemas with Zod, mirroring the functionality and intent of the original Python examples.

0 comments on commit 3ec74f8

Please sign in to comment.