Skip to content

fix test workflows

fix test workflows #95

name: Run Test on Multiple Node Versions
on:
push:
branches:
- main
- 'feature/*'
- 'bugfix/*'
pull_request:
branches:
- main
- 'feature/*'
- 'bugfix/*'
jobs:
test:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
RESEND_API: ${{ secrets.RESEND_API }}
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 code
uses: actions/checkout@v2
- name: Set up .env file for tests
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> .env
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
run: npm install -g pnpm
- 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: Run tests
run: pnpm test