-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (37 loc) · 1004 Bytes
/
tests.yml
File metadata and controls
46 lines (37 loc) · 1004 Bytes
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
name: Run Tests
on:
pull_request:
jobs:
test:
if: github.base_ref == 'main'
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.18"
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: |
~/.bun
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Generate Prisma client
run: bun run generate
- name: Run tests
run: bun jest
skip-tests:
if: github.base_ref != 'main'
runs-on: ubuntu-latest
steps:
- name: Skip tests for non-main PR
run: echo "Tests skipped - PR is not targeting main branch"