feat: enhance e2e tests and add working memory persistence for libsql #80
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: Prerelease | |
| on: | |
| push: | |
| branches: | |
| - next | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-packages: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: | |
| - cli | |
| - core | |
| - create-voltagent-app | |
| - docs-mcp | |
| - internal | |
| - logger | |
| - postgres | |
| - supabase | |
| - voice | |
| - server-core | |
| - libsql | |
| fail-fast: false | |
| name: Test ${{ matrix.package }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=8192" | |
| - name: Set package scope | |
| id: scope | |
| run: | | |
| if [[ "${{ matrix.package }}" == "create-voltagent-app" ]]; then | |
| echo "scope=create-voltagent-app" >> $GITHUB_OUTPUT | |
| else | |
| echo "scope=@voltagent/${{ matrix.package }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build Package and Dependencies | |
| run: lerna run build --scope "${{ steps.scope.outputs.scope }}" --include-dependencies | |
| - name: Test Package | |
| run: lerna run test --scope "${{ steps.scope.outputs.scope }}" | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| name: E2E Tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=8192" | |
| - name: Build E2E Dependencies | |
| run: pnpm lerna run build --scope @voltagent/e2e --include-dependencies | |
| - name: Run E2E Tests | |
| run: pnpm --filter @voltagent/e2e test | |
| prerelease: | |
| name: Prerelease | |
| needs: [test-packages, e2e-tests] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: read | |
| pull-requests: write | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: voltagent_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.VOLTAGENT_BOT }} | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Creating .npmrc | |
| run: | | |
| cat << EOF > "$HOME/.npmrc" | |
| //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
| EOF | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install Dependencies | |
| run: pnpm install | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=8192" | |
| - name: Build All Packages | |
| run: pnpm build:all | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=8192' | |
| - name: Lint with Biome | |
| run: pnpm lint:ci | |
| - name: Syncpack | |
| run: pnpm sp lint | |
| - name: Publint | |
| run: pnpm publint:all | |
| #- name: Are The Types Wrong | |
| # run: pnpm attw:all | |
| - name: PostgreSQL Integration Tests | |
| run: | | |
| cd packages/postgres | |
| npm run test:integration:ci | |
| env: | |
| DATABASE_URL: postgresql://test:test@localhost:5432/voltagent_test | |
| - name: Verify Changesets prerelease mode | |
| run: | | |
| node <<'NODE' | |
| const pre = require("./.changeset/pre.json"); | |
| if (pre.mode !== "pre" || pre.tag !== "next") { | |
| throw new Error( | |
| 'Expected Changesets prerelease mode with tag "next". Run "pnpm changeset pre enter next" on the next branch before publishing.', | |
| ); | |
| } | |
| NODE | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| # This will run pnpm version-packages which handles prerelease mode | |
| version: pnpm version-packages | |
| # This will run pnpm changeset publish (tag is handled by pre mode) | |
| publish: pnpm changeset publish | |
| title: '[Prerelease] Version Packages' | |
| commit: 'chore: version packages (prerelease)' | |
| createGithubReleases: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.VOLTAGENT_BOT }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |