mirror of
https://github.com/better-auth/better-auth.git
synced 2026-07-19 04:08:43 -05:00
cac8d2ae7b
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
228 lines
8.2 KiB
YAML
228 lines
8.2 KiB
YAML
name: E2E
|
|
on:
|
|
push:
|
|
branches: [ main, next ]
|
|
merge_group:
|
|
pull_request:
|
|
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM || github.repository_owner }}
|
|
BETTER_AUTH_TELEMETRY_ENDPOINT: ${{ vars.BETTER_AUTH_TELEMETRY_ENDPOINT }}
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
smoke:
|
|
name: Smoke test (${{ matrix.node-version }})
|
|
timeout-minutes: 30
|
|
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'better-auth/better-auth' || github.event_name != 'pull_request' && github.repository == 'better-auth/better-auth') && 'starsling-ubuntu-24.04' || 'ubuntu-24.04' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [22.x, 24.x]
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
COMPOSE_SERVICES: redis
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Cache turbo build setup
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-
|
|
|
|
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
|
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
# Use the latest patch per major: the smoke specs run `node --test` on .ts,
|
|
# which needs native type-stripping (default-on at 22.18+/24), not the cached 22.13.0.
|
|
check-latest: true
|
|
registry-url: 'https://registry.npmjs.org'
|
|
cache: pnpm
|
|
|
|
- name: Install
|
|
run: pnpm install
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Reset Docker Containers
|
|
run: docker compose down --volumes --remove-orphans
|
|
|
|
- name: Start Docker Containers
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose up -d --wait --wait-timeout 60 "${compose_services[@]}"
|
|
|
|
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
|
|
- uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
|
with:
|
|
deno-version: 2.6.4
|
|
|
|
- name: Smoke
|
|
run: pnpm e2e:smoke
|
|
|
|
- name: Docker Compose Diagnostics
|
|
if: failure() && hashFiles('docker-compose.yml') != ''
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose ps --all || true
|
|
docker compose logs --no-color "${compose_services[@]}" || true
|
|
|
|
- name: Stop Docker Containers
|
|
if: always() && hashFiles('docker-compose.yml') != ''
|
|
run: docker compose down --volumes --remove-orphans
|
|
integration:
|
|
name: Integration test
|
|
timeout-minutes: 60
|
|
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'better-auth/better-auth' || github.event_name != 'pull_request' && github.repository == 'better-auth/better-auth') && 'starsling-ubuntu-24.04' || 'ubuntu-24.04' }}
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
COMPOSE_SERVICES: postgres
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Cache turbo build setup
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-
|
|
|
|
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
|
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
cache: pnpm
|
|
|
|
- name: Install
|
|
run: pnpm install
|
|
|
|
- name: Install Playwright Browsers
|
|
uses: ./.github/actions/setup-playwright
|
|
|
|
- name: Reset Docker Containers
|
|
run: docker compose down --volumes --remove-orphans
|
|
|
|
- name: Start Docker Containers
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose up -d --wait --wait-timeout 60 "${compose_services[@]}"
|
|
|
|
- name: Integration
|
|
run: pnpm e2e:integration --filter=./e2e/integration
|
|
|
|
- name: Docker Compose Diagnostics
|
|
if: failure() && hashFiles('docker-compose.yml') != ''
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose ps --all || true
|
|
docker compose logs --no-color "${compose_services[@]}" || true
|
|
|
|
- name: Stop Docker Containers
|
|
if: always() && hashFiles('docker-compose.yml') != ''
|
|
run: docker compose down --volumes --remove-orphans
|
|
adapter-integration:
|
|
name: ${{ matrix.packages }} Integration Test
|
|
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'better-auth/better-auth' || github.event_name != 'pull_request' && github.repository == 'better-auth/better-auth') && 'starsling-ubuntu-24.04' || 'ubuntu-24.04' }}
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- packages: "@better-auth-test/adapter-factory"
|
|
compose_services: ""
|
|
- packages: "@better-auth-test/drizzle-adapter"
|
|
compose_services: "postgres mysql"
|
|
- packages: "@better-auth-test/kysely-prisma-adapter"
|
|
compose_services: "postgres-kysely mysql-kysely postgres-kysely2 mssql"
|
|
- packages: "@better-auth-test/memory-adapter"
|
|
compose_services: ""
|
|
- packages: "@better-auth-test/mongo-adapter"
|
|
compose_services: "mongodb"
|
|
- packages: "@better-auth-test/prisma-adapter"
|
|
compose_services: "postgres-prisma mysql-prisma"
|
|
env:
|
|
COMPOSE_SERVICES: ${{ matrix.compose_services }}
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Cache turbo build setup
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-
|
|
|
|
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
|
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
cache: pnpm
|
|
|
|
- name: Install
|
|
run: pnpm install
|
|
|
|
- name: Reset Docker Containers
|
|
run: docker compose down --volumes --remove-orphans
|
|
|
|
- name: Start Docker Containers
|
|
if: matrix.compose_services != ''
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose up -d --wait --wait-timeout 60 "${compose_services[@]}"
|
|
|
|
- name: Adapter Integration
|
|
env:
|
|
FILTER: ${{ matrix.packages }}
|
|
run: pnpm e2e:integration --filter="$FILTER"
|
|
|
|
- name: Docker Compose Diagnostics
|
|
if: failure() && hashFiles('docker-compose.yml') != '' && matrix.compose_services != ''
|
|
run: |
|
|
read -r -a compose_services <<< "$COMPOSE_SERVICES"
|
|
docker compose ps --all || true
|
|
docker compose logs --no-color "${compose_services[@]}" || true
|
|
|
|
- name: Stop Docker Containers
|
|
if: always() && hashFiles('docker-compose.yml') != ''
|
|
run: docker compose down --volumes --remove-orphans
|
|
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
needs: [smoke, integration, adapter-integration]
|
|
if: always()
|
|
steps:
|
|
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|