diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..427df5d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Run Scenario Tests + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.26.0 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run scenario tests + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + LANGWATCH_API_KEY: ${{ secrets.LANGWATCH_API_KEY }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + run: pnpm test:scenarios