-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61a3e91
commit 99e6af3
Showing
1 changed file
with
17 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,34 @@ | ||
name: Full Stack Tests | ||
name: Run tests | ||
|
||
on: [push, pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
build-and-test: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.17.1] | ||
mongodb-version: ['7.0.2'] | ||
services: | ||
mongodb: | ||
image: mongo:${{ matrix.mongodb-version }} | ||
env: | ||
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }} | ||
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }} | ||
ports: | ||
- 27017:27017 | ||
options: >- | ||
--health-cmd mongo | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
node-version: [18.17] | ||
mongodb-version: ['7.0'] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Backend Dependencies | ||
run: | | ||
cd backend | ||
npm install | ||
- name: Initialize Database | ||
run: | | ||
MONGODB_URI=${{ secrets.MONGODB_URI }} npm run initialize-db | ||
- name: Build Backend | ||
run: | | ||
cd backend | ||
npm run build | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: ${{ matrix.mongodb-version }} | ||
mongodb-replica-set: test-rs | ||
mongodb-port: 42069 | ||
|
||
- name: Start Backend | ||
- name: Install Backend Dependencies | ||
run: | | ||
cd backend | ||
npm run start & | ||
- name: Install Frontend Dependencies | ||
run: | | ||
cd frontend | ||
npm install | ||
- name: Run Frontend Tests | ||
run: | | ||
cd frontend | ||
npm run test:e2e | ||
timeout-minutes: 30 |