-
Notifications
You must be signed in to change notification settings - Fork 1.5k
52 lines (47 loc) · 1.37 KB
/
test.yaml
File metadata and controls
52 lines (47 loc) · 1.37 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
name: test
on:
push:
paths:
- orm/**
- databases/**
- tests/**
- package.json
- vitest.config.ts
branches:
- latest
pull_request:
env:
CI: 1
PRISMA_TELEMETRY_INFORMATION: 'prisma-examples test.yaml'
SLACK_WEBHOOK_URL_FAILING: ${{ secrets.SLACK_WEBHOOK_URL_FAILING }}
SKIP_PRISMA_VERSION_CHECK: true
jobs:
# Generate test matrix from test files
test-matrix:
if: github.repository_owner == 'prisma'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
# Find all test files and create matrix JSON
tests=$(find tests -name "*.test.ts" | sed 's|tests/||' | sed 's|\.test\.ts||' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix={\"test\":$tests}" >> $GITHUB_OUTPUT
test:
needs: test-matrix
if: github.repository_owner == 'prisma'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install root dependencies
run: npm install
- name: Run test - ${{ matrix.test }}
run: npx vitest run tests/${{ matrix.test }}.test.ts