Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
afurgapil committed Jun 22, 2024
1 parent 104dc72 commit 6427a71
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: librarymanagementsystem_test
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports:
- 5432:5432

Expand All @@ -31,6 +31,14 @@ jobs:
- name: Install dependencies
run: go mod download

- name: Create .env.test file
run: |
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env.test
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env.test
echo "DB_USER=${{ secrets.DB_USER }}" >> .env.test
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env.test
echo "DB_NAME=${{ secrets.DB_NAME }}" >> .env.test
- name: Start PostgreSQL and wait for connection
run: |
sudo apt-get update
Expand All @@ -47,4 +55,4 @@ jobs:
run: ./scripts/create_migrations.sh

- name: Run tests
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
run: go test -v ./... -covermode=atomic

0 comments on commit 6427a71

Please sign in to comment.