name: Run Cognitive Tests on: pull_request: paths: - 'packages/cognitive/**' - '.github/workflows/run-cognitive-tests.yml' permissions: id-token: write contents: read jobs: run-cognitive-tests: runs-on: ubuntu-latest timeout-minutes: 15 env: NODE_OPTIONS: '--max_old_space_size=8192' steps: - uses: actions/checkout@v2 - name: Setup uses: ./.github/actions/setup with: extra_filters: '-F @botpress/cognitive' - name: Login env: BP_API_URL: 'https://api.botpress.dev' BP_WORKSPACE_ID: ${{ secrets.STAGING_E2E_TESTS_WORKSPACE_ID }} BP_TOKEN: ${{ secrets.STAGING_TOKEN_CLOUD_OPS_ACCOUNT }} run: | pnpm bp login - name: Run Cognitive Tests id: 'run-tests' env: CLOUD_PAT: ${{ secrets.STAGING_TOKEN_CLOUD_OPS_ACCOUNT }} run: | bot_id=$(pnpm bp bots new --json | jq -r ".id") echo "bot_id=$bot_id" >> "$GITHUB_OUTPUT" export CLOUD_API_ENDPOINT='https://api.botpress.dev' export CLOUD_BOT_ID="$bot_id" pnpm -F cognitive run test:e2e - name: Cleanup if: ${{ always() }} env: BOT_ID: ${{ steps.run-tests.outputs.bot_id }} run: | pnpm bp bots rm "$BOT_ID"