mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: "Run setup tests"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
|
|
|
|
env:
|
|
SHELL: /usr/bin/bash
|
|
|
|
jobs:
|
|
setup-tests:
|
|
if: ${{ (github.head_ref || github.ref_name) == 'dev' }}
|
|
runs-on: ubicloud-standard-16
|
|
env:
|
|
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
|
|
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js v20
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Install packages
|
|
run: pnpm install
|
|
|
|
- run: pnpm run build:packages
|
|
- run: pnpm run codegen
|
|
- run: pnpm run start-deps
|
|
|
|
- uses: JarvusInnovations/background-action@v1.0.7
|
|
with:
|
|
run: pnpm run dev &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 120s
|
|
log-output-if: true
|
|
- name: Run tests (first attempt)
|
|
id: run-tests-first-attempt
|
|
continue-on-error: ${{ (github.head_ref || github.ref_name) != 'main' && (github.head_ref || github.ref_name) != 'dev' }}
|
|
run: pnpm run test run --reporter=verbose
|
|
|
|
# These tests are often flakey, as a temporary measure we retry them once.
|
|
- name: Run tests (retry once on non-dev/main branches)
|
|
if: ${{ (github.head_ref || github.ref_name) != 'main' && (github.head_ref || github.ref_name) != 'dev' && steps.run-tests-first-attempt.outcome == 'failure' }}
|
|
run: pnpm run test run --reporter=verbose
|