Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmdksh authored Oct 13, 2023
1 parent 95fdfb6 commit b59533c
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,16 @@ jobs:

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

- name: Update .env file
run: |
echo "DATABASE_URL='postgresql://postgres:postgres@localhost:5432/my_db'" >> .env
echo "NODE_ENV='production'" >> .env
echo "PORT=7070" >> .env
echo "PW_BACKEND_URL='localhost'" >> .env
- name: Test docker-compose setup
run: |
docker-compose build
docker-compose up -d
sleep 30
- name: Wait for PostgreSQL db
uses: MaximeGoyette/wait-for-it-action@master
uses: actions/checkout@v3
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
host: 127.0.0.1
port: 5432

- name: Test docker-compose setup
node-version: 18
- name: Install Dependencies
run: |
# Check if both services are running.
if ! (docker-compose ps | grep "pw-backend" | grep "Up"); then
echo "pw-backend service did not start successfully."
docker-compose logs pw-backend
exit 1
fi
# Check logs for errors
if (docker-compose logs pw-backend | grep "ERROR"); then
echo "Errors found in the logs of pw-backend services."
docker-compose logs pw-backend | grep "ERROR"
exit 1
fi
docker-compose down
npm install -g @nestjs/cli
npm install
- name: Build
run: npm run build
- name: Migrations
run: npx prisma migrate dev

0 comments on commit b59533c

Please sign in to comment.