Skip to content

Commit

Permalink
create env file
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn committed Dec 15, 2024
1 parent 59f13d3 commit ce66c20
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/test.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ jobs:
- name: Run golangci-lint
run: golangci-lint run ./...

- name: Create env file
working-directory: ./server/test/e2e
run: |
{
echo DB_HOST=${{ vars.DB_HOST }}
echo DB_PORT=${{ vars.DB_PORT }}
echo DB_USER=${{ vars.DB_USER }}
echo DB_PASSWORD=${{ secrets.DB_PASSWORD }}
echo DB_NAME=${{ vars.DB_NAME }}
echo CORS_ALLOWED_ORIGIN=${{ vars.CORS_ALLOWED_ORIGIN }}
echo SERVER_PORT=${{ vars.SERVER_PORT }}
echo SERVER_CERT_PATH=${{ vars.SERVER_CERT_PATH }}
echo SERVER_KEY_PATH=${{ vars.SERVER_KEY_PATH }}
echo COOKIE_DOMAIN=${{ vars.COOKIE_DOMAIN }}
echo JWT_ACCESS_TOKEN_KEY=${{ secrets.JWT_ACCESS_TOKEN_KEY }}
echo JWT_REFRESH_TOKEN_KEY=${{ secrets.JWT_REFRESH_TOKEN_KEY }}
} >> .env
- name: Run tests with coverage
run: go test ./... -coverprofile=coverage.out

Expand Down
13 changes: 13 additions & 0 deletions server/test/e2e/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DB_HOST=localhost
DB_PORT=5433
DB_USER=root
DB_PASSWORD=root
DB_NAME=postgres
CORS_ALLOWED_ORIGIN=http://macbookpro.local:5173,http://localhost:5173
SERVER_PORT=8081
SSE_PORT=8081
SERVER_CERT_PATH=/Users/christian/Code/crlssn/getstronger/.secrets/localhost.crt
SERVER_KEY_PATH=/Users/christian/Code/crlssn/getstronger/.secrets/localhost.key
COOKIE_DOMAIN=
JWT_ACCESS_TOKEN_KEY=access-key
JWT_REFRESH_TOKEN_KEY=refresh-key
2 changes: 1 addition & 1 deletion server/test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

func TestE2E(t *testing.T) {
t.Parallel()
if err := godotenv.Load("../../../.env"); err != nil {
if err := godotenv.Load(); err != nil {
require.NoError(t, err)
}

Expand Down

0 comments on commit ce66c20

Please sign in to comment.