feat!: move to timestamps in response models #9191
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| push: | |
| branches: | |
| - master | |
| env: | |
| BUILD_CACHE_KEY: ${{ github.sha }}-dist | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: ESLint & Prettier | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-node | |
| - run: yarn lint | |
| # scripts/ is outside the src tsconfigs and is not linted; Node 24 strips the types in | |
| # the .mts build scripts without checking them, so check them here. | |
| - name: Typecheck build scripts | |
| run: yarn types:scripts | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| contents: read | |
| name: Build & Validate | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-node | |
| - run: yarn build | |
| - name: Validate CJS bundle with Node ${{ env.NODE_VERSION }} | |
| run: yarn validate-cjs | |
| - name: Validate ESM bundle with Node ${{ env.NODE_VERSION }} | |
| run: yarn validate-esm | |
| - name: Validate translations are in sync with source | |
| # `yarn build` above already ran build-translations, which regenerates keys.ts from the | |
| # t() call sites and runtimeDefaults.ts. A diff here means the author changed a call site | |
| # without regenerating. Scoped to the one generated file so unrelated edits under | |
| # src/i18n (tests, Streami18n, runtimeDefaults) do not trip it. | |
| run: git diff --exit-code -- src/i18n/keys.ts | |
| - name: Cache Build Output | |
| uses: actions/cache@v5 | |
| with: | |
| path: ./dist | |
| key: '${{ env.BUILD_CACHE_KEY }}' | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Test | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-node | |
| - name: Test with Node ${{ env.NODE_VERSION }} | |
| run: yarn coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| deploy-vite-example: | |
| concurrency: | |
| cancel-in-progress: true | |
| # one deployment per PR, not commit | |
| group: "${{ github.base_ref || github.ref_name }}:${{ github.head_ref || 'nil' }}:${{matrix.projects.project-id}}" | |
| strategy: | |
| matrix: | |
| projects: | |
| - name: Vite Example Development | |
| project-id: prj_2Rq8kuNd0BmqKd2NwvkDjX9Htnx5 | |
| stream-api-key: rq7ntdb4zzsq | |
| - name: Vite Example Public | |
| project-id: prj_yBYBe1AJV0tbpTqxCMzcyRfFWXxP | |
| stream-api-key: xzwhhgtazy6h | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: "${{ matrix.projects.name }} (${{ github.ref_name == 'master' && 'Production' || 'Preview' }})" | |
| deployment: true | |
| url: '${{ steps.deploy-to-vercel.outputs.deploy-url }}' | |
| # skip if build fails | |
| needs: | |
| - build | |
| name: Deploy Vite Example to Vercel | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ matrix.projects.project-id }} | |
| VITE_STREAM_API_KEY: ${{ matrix.projects.stream-api-key }} | |
| NODE_ENV: production | |
| DEPLOY_ENVIRONMENT: ${{ github.ref_name == 'master' && 'production' || 'preview' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-node | |
| env: | |
| NODE_ENV: '' | |
| - name: Recover Build Output | |
| id: build-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ./dist | |
| key: '${{ env.BUILD_CACHE_KEY }}' | |
| - name: Build SDK | |
| if: steps.build-cache.outputs.cache-hit != 'true' | |
| run: yarn build | |
| - name: Vercel Pull/Build/Deploy | |
| working-directory: examples/vite | |
| id: deploy-to-vercel | |
| env: | |
| # "target=production" is not treated the same way "--prod" does | |
| PROD_FLAG: ${{ env.DEPLOY_ENVIRONMENT == 'production' && '--prod' || '' }} | |
| run: >- | |
| npx vercel pull --yes --environment=${{ env.DEPLOY_ENVIRONMENT }} --token=${{ secrets.VERCEL_TOKEN }} && | |
| npx vercel build ${{ env.PROD_FLAG }} && | |
| npx vercel deploy ${{ env.PROD_FLAG }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | | |
| xargs -I % echo "deploy-url=%" >> "$GITHUB_OUTPUT" |