|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - next |
| 7 | + |
| 8 | +jobs: |
| 9 | + detect_breaking_changes: |
| 10 | + runs-on: 'ubuntu-latest' |
| 11 | + name: detect-breaking-changes |
| 12 | + if: github.repository == 'openai/openai-node' |
| 13 | + steps: |
| 14 | + - name: Calculate fetch-depth |
| 15 | + run: | |
| 16 | + echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV |
| 17 | +
|
| 18 | + - uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + # Ensure we can check out the pull request base in the script below. |
| 21 | + fetch-depth: ${{ env.FETCH_DEPTH }} |
| 22 | + |
| 23 | + - name: Set up Node |
| 24 | + uses: actions/setup-node@v3 |
| 25 | + with: |
| 26 | + node-version: '20' |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + yarn install |
| 30 | +
|
| 31 | + - name: Detect breaking changes |
| 32 | + run: | |
| 33 | + # Try to check out previous versions of the breaking change detection script. This ensures that |
| 34 | + # we still detect breaking changes when entire files and their tests are removed. |
| 35 | + git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true |
| 36 | + ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} |
| 37 | + agents_sdk: |
| 38 | + runs-on: 'ubuntu-latest' |
| 39 | + name: Detect Agents SDK regressions |
| 40 | + if: github.repository == 'openai/openai-node' |
| 41 | + steps: |
| 42 | + - name: Set up Node |
| 43 | + uses: actions/setup-node@v4 |
| 44 | + with: |
| 45 | + node-version: '20' |
| 46 | + |
| 47 | + - name: Install pnpm |
| 48 | + uses: pnpm/action-setup@v4 |
| 49 | + with: |
| 50 | + version: 10.25.0 |
| 51 | + run_install: false |
| 52 | + |
| 53 | + # Setup this sdk |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + path: openai-node |
| 57 | + |
| 58 | + - name: Bootstrap |
| 59 | + working-directory: openai-node |
| 60 | + run: ./scripts/bootstrap |
| 61 | + |
| 62 | + - name: Build |
| 63 | + working-directory: openai-node |
| 64 | + run: ./scripts/build |
| 65 | + |
| 66 | + # Setup the agents packages |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + repository: openai/openai-agents-js |
| 70 | + path: openai-agents-js |
| 71 | + |
| 72 | + - name: Link agents packages to local SDKs |
| 73 | + working-directory: openai-agents-js |
| 74 | + run: pnpm --filter @openai/agents-core --filter @openai/agents-openai --filter @openai/agents add file:../../../openai-node/dist |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + working-directory: openai-agents-js |
| 78 | + run: pnpm install |
| 79 | + |
| 80 | + - name: Build all packages |
| 81 | + working-directory: openai-agents-js |
| 82 | + run: pnpm build |
| 83 | + |
| 84 | + - name: Run linter |
| 85 | + working-directory: openai-agents-js |
| 86 | + run: pnpm lint |
| 87 | + |
| 88 | + - name: Type-check docs scripts |
| 89 | + working-directory: openai-agents-js |
| 90 | + run: pnpm docs:scripts:check |
0 commit comments