forked from SkidGod4444/plura
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.68 KB
/
test-multiple-node-versions.yml
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
name: Run Test on Multiple Node Versions
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'feat/*'
- 'bugfix/*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.18.0, 18.20.4, 22.11.0, 19.9.0, 23.1.0] # Ensure all versions are >= v18
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.12.1
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Set environment variables
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> $GITHUB_ENV
echo "RESEND_API=${{ secrets.RESEND_API }}" >> $GITHUB_ENV
- name: Log environment variables (debug)
run: |
echo "DATABASE_URL=$DATABASE_URL"
echo "RESEND_API=$RESEND_API"
- name: Set up .env file for tests in apps/api
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> apps/api/.env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> apps/api/.env
cat apps/api/.env # Verify .env contents
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
- name: Install trubo
run: pnpm install -g turbo
- name: Run Turbo tests
run: turbo test