ci.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. name: CI
  2. on:
  3. push:
  4. branches-ignore:
  5. - 'generated'
  6. - 'codegen/**'
  7. - 'integrated/**'
  8. - 'stl-preview-head/**'
  9. - 'stl-preview-base/**'
  10. pull_request:
  11. branches-ignore:
  12. - 'stl-preview-head/**'
  13. - 'stl-preview-base/**'
  14. jobs:
  15. lint:
  16. timeout-minutes: 10
  17. name: lint
  18. runs-on: ${{ github.repository == 'stainless-sdks/opencode-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
  19. if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
  20. steps:
  21. - uses: actions/checkout@v4
  22. - name: Set up Node
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: '20'
  26. - name: Bootstrap
  27. run: ./scripts/bootstrap
  28. - name: Check types
  29. run: ./scripts/lint
  30. build:
  31. timeout-minutes: 5
  32. name: build
  33. runs-on: ${{ github.repository == 'stainless-sdks/opencode-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
  34. if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
  35. permissions:
  36. contents: read
  37. id-token: write
  38. steps:
  39. - uses: actions/checkout@v4
  40. - name: Set up Node
  41. uses: actions/setup-node@v4
  42. with:
  43. node-version: '20'
  44. - name: Bootstrap
  45. run: ./scripts/bootstrap
  46. - name: Check build
  47. run: ./scripts/build
  48. - name: Get GitHub OIDC Token
  49. if: github.repository == 'stainless-sdks/opencode-typescript'
  50. id: github-oidc
  51. uses: actions/github-script@v6
  52. with:
  53. script: core.setOutput('github_token', await core.getIDToken());
  54. - name: Upload tarball
  55. if: github.repository == 'stainless-sdks/opencode-typescript'
  56. env:
  57. URL: https://pkg.stainless.com/s
  58. AUTH: ${{ steps.github-oidc.outputs.github_token }}
  59. SHA: ${{ github.sha }}
  60. run: ./scripts/utils/upload-artifact.sh
  61. test:
  62. timeout-minutes: 10
  63. name: test
  64. runs-on: ${{ github.repository == 'stainless-sdks/opencode-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
  65. if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
  66. steps:
  67. - uses: actions/checkout@v4
  68. - name: Set up Node
  69. uses: actions/setup-node@v4
  70. with:
  71. node-version: '20'
  72. - name: Bootstrap
  73. run: ./scripts/bootstrap
  74. - name: Run tests
  75. run: ./scripts/test