Repository navigation
150 lines (140 loc) · 6.44 KB
/
Copy pathci.yml
File metadata and controls
150 lines (140 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '37 6 * * *'
workflow_dispatch:
workflow_call:
inputs:
ref:
description: Git ref to verify instead of the triggering workflow SHA
required: false
type: string
permissions: {}
jobs:
ci:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- run: corepack enable
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: pnpm
- run: pnpm install
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm typecheck:runtime-server
- run: pnpm typecheck:playground
- run: pnpm prepack
- run: pnpm dev:build
env:
BETTER_AUTH_SECRET: ci-test-secret-12345678901234567890
- run: pnpm build:docs
- run: pnpm exec playwright-core install --with-deps chromium
- run: pnpm test
- run: pnpm test:runtime
compatibility:
env:
COMPATIBILITY_DATABASE: ${{ matrix.nuxt.database }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nuxt:
- version: 4.5.0
database: true
# Keep merge proof on a reviewed snapshot; float nightlies only in non-gating surveillance.
# NuxtHub 0.10.8 still imports Nitro 2 APIs; retain the no-DB Nuxt 5 smoke check.
- version: npm:nuxt-nightly@5.0.0-2610052343-36eafab
database: false
better_auth:
- 1.7.3
# Resolve the newest supported stable release on each run, including the daily check.
- ^1.7.3
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- run: corepack enable
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: pnpm
- run: pnpm install
- run: pnpm pack --pack-destination /tmp
- run: cp -R test/compatibility/fixture /tmp/nuxt-better-auth-compatibility
- name: Install compatibility dependencies
timeout-minutes: 5
working-directory: /tmp/nuxt-better-auth-compatibility
run: corepack pnpm@11.21.0 add --save-exact "nuxt@${{ matrix.nuxt.version }}" "better-auth@${{ matrix.better_auth }}" "auth@${{ matrix.better_auth }}" @nuxthub/core@0.10.8 @libsql/client@0.17.4 drizzle-orm@0.45.2 drizzle-kit@0.31.10 typescript@5.9.3 vue@3.5.40 vue-tsc@3.2.7 /tmp/nuxtjs-better-auth-*.tgz
- run: corepack pnpm@11.21.0 typecheck
working-directory: /tmp/nuxt-better-auth-compatibility
- run: corepack pnpm@11.21.0 db:generate && corepack pnpm@11.21.0 db:migrate
if: matrix.nuxt.database
working-directory: /tmp/nuxt-better-auth-compatibility
- run: corepack pnpm@11.21.0 build
working-directory: /tmp/nuxt-better-auth-compatibility
- run: node test/compatibility/check.mjs /tmp/nuxt-better-auth-compatibility
# Keep the published lower bounds executable without multiplying the current/latest matrix.
# This tests Nuxt 4.0.0 with the packed module's declared Kit dependency (^4.6.0),
# as consumers install it. It does not claim support for running the module on Kit 4.0.0.
minimum-compatibility:
env:
COMPATIBILITY_DATABASE: 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- run: corepack enable
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: pnpm
- run: pnpm install
- run: pnpm pack --pack-destination /tmp
- run: cp -R test/compatibility/fixture /tmp/nuxt-better-auth-minimum-compatibility
- name: Install minimum compatibility dependencies
timeout-minutes: 5
working-directory: /tmp/nuxt-better-auth-minimum-compatibility
run: corepack pnpm@11.21.0 add --save-exact nuxt@4.0.0 better-auth@1.7.3 auth@1.7.3 @nuxthub/core@0.10.5 @libsql/client@0.17.4 drizzle-orm@0.45.2 drizzle-kit@0.31.10 typescript@5.9.3 vue@3.5.40 vue-tsc@3.2.7 /tmp/nuxtjs-better-auth-*.tgz
- name: Verify published minimum dependency graph
working-directory: /tmp/nuxt-better-auth-minimum-compatibility
run: |
node --input-type=module <<'NODE'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { createRequire } from 'node:module'
const consumerRequire = createRequire(import.meta.url)
const moduleRequire = createRequire(import.meta.resolve('@nuxtjs/better-auth'))
const nuxtVersion = consumerRequire('nuxt/package.json').version
const kitVersion = moduleRequire('@nuxt/kit/package.json').version
assert.equal(nuxtVersion, '4.0.0')
const [major, minor] = kitVersion.split('.').map(Number)
assert.ok(major === 4 && minor >= 6,
`Expected the module's declared Kit ^4.6.0, got ${kitVersion}`)
console.log(`Published consumer graph: Nuxt ${nuxtVersion}, module Kit ${kitVersion}`)
// auth pins an exact better-auth; a second copy breaks the consumer's Better Auth types.
const lockfile = readFileSync('pnpm-lock.yaml', 'utf8')
for (const name of ['better-auth', '@better-auth/core']) {
const versions = new Set([...lockfile.matchAll(new RegExp(`^ '?${name}@(\\d[^(:']*)`, 'gm'))].map(match => match[1]))
assert.deepEqual([...versions], ['1.7.3'], `Expected one ${name} version, got ${[...versions].join(', ')}`)
}
NODE
- run: corepack pnpm@11.21.0 typecheck
working-directory: /tmp/nuxt-better-auth-minimum-compatibility
- run: corepack pnpm@11.21.0 db:generate && corepack pnpm@11.21.0 db:migrate
working-directory: /tmp/nuxt-better-auth-minimum-compatibility
- run: corepack pnpm@11.21.0 build
working-directory: /tmp/nuxt-better-auth-minimum-compatibility
- run: node test/compatibility/check.mjs /tmp/nuxt-better-auth-minimum-compatibility