Skip to content

Commit

Permalink
fix test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
SkidGod4444 committed Nov 11, 2024
1 parent a121a69 commit 99661b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
42 changes: 16 additions & 26 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@ on:
- 'bugfix/*'

jobs:
lint:
setup:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21.7.1'
node-version: '21.7.1'

- name: Install pnpm
run: npm install -g pnpm

- name: Cache pnpm modules
uses: actions/cache@v3
with:
Expand All @@ -39,39 +38,30 @@ jobs:
- name: Install dependencies
run: pnpm install --shamefully-hoist

lint:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run Lint
run: pnpm lint

test:
runs-on: ubuntu-latest
needs: lint
needs: [setup, lint]
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
RESEND_API: ${{ secrets.RESEND_API }}


steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21.7.1'

- 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: Set up .env file for tests
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> .env
- name: Run tests
- name: Run Tests
run: pnpm test
9 changes: 7 additions & 2 deletions .github/workflows/test-multiple-node-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ jobs:
RESEND_API: ${{ secrets.RESEND_API }}
strategy:
matrix:
node-version: [20.18.0, 18.20.4, 22.11.0, 19.9.0, 23.1.0] # we dont support bellow v18
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:
Expand All @@ -44,6 +49,6 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm test

0 comments on commit 99661b1

Please sign in to comment.