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 99661b1 commit ab996a3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- 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
Expand All @@ -45,6 +45,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js (again to ensure pnpm is available)
uses: actions/setup-node@v2
with:
node-version: '21.7.1'

- name: Install pnpm (again in case the previous job isolated the environment)
run: npm install -g pnpm

- name: Run Lint
run: pnpm lint

Expand All @@ -60,8 +68,16 @@ jobs:

- name: Set up .env file for tests
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> .env
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> apps/api/.env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> apps/api/.env
- name: Set up Node.js (again to ensure pnpm is available)
uses: actions/setup-node@v2
with:
node-version: '21.7.1'

- name: Install pnpm (again in case the previous job isolated the environment)
run: npm install -g pnpm

- name: Run Tests
run: pnpm test
15 changes: 12 additions & 3 deletions .github/workflows/test-multiple-node-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up .env file for tests
- name: Set up .env file for tests in apps/api
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> .env
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> apps/api/.env
echo "RESEND_API=${{ secrets.RESEND_API }}" >> apps/api/.env
- name: Set up Node.js
uses: actions/setup-node@v2
Expand All @@ -52,3 +52,12 @@ jobs:

- name: Run tests
run: pnpm test

# Ensuring environment is correctly set for vitest tests
- name: Set environment variables for vitest in apps/api
run: |
echo "RESEND_API=${{ secrets.RESEND_API }}" >> apps/api/.env
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> apps/api/.env
env:
RESEND_API: ${{ secrets.RESEND_API }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}

0 comments on commit ab996a3

Please sign in to comment.