Skip to content

Commit

Permalink
refactor: refactor test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoub3bidi committed Feb 24, 2024
1 parent f6c46ca commit a2f8342
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Create environment file
run: |
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
- name: Run integration tests
run: |
setsid ./ci/integration-test.sh
Expand All @@ -35,14 +27,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Create environment file
run: |
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
- name: Run unit tests
run: |
setsid ./ci/unit-test.sh
6 changes: 6 additions & 0 deletions ci/integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env bash

echo "POSTGRES_HOST=${{ env.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ env.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ env.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ env.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }}" >> .env

docker-compose up --build --abort-on-container-exit mercury_integration_tests
6 changes: 6 additions & 0 deletions ci/unit-test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env bash

echo "POSTGRES_HOST=${{ env.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ env.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ env.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ env.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }}" >> .env

docker-compose up --build --abort-on-container-exit mercury_unit_tests

0 comments on commit a2f8342

Please sign in to comment.