Skip to content

Commit bf2f25a

Browse files
committed
Updated workflow for migrations
1 parent 739e098 commit bf2f25a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/workflow.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,24 @@ jobs:
3636
--health-interval 10s
3737
--health-timeout 5s
3838
--health-retries 5
39+
3940
steps:
4041
- uses: actions/checkout@v4
4142
- name: Set up Go
4243
uses: actions/setup-go@v5
4344
with:
4445
go-version: 1.22.4
45-
4646
- name: Install golang-migrate
4747
run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
48-
49-
# Run migrations before the tests
5048
- name: Run Migrations
5149
env:
52-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
50+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bookreviewapp_test?sslmode=disable
5351
run: |
54-
migrate -path ./migrations -database $DATABASE_URL up
55-
52+
migrate -path ./migrations -database "$DATABASE_URL" up
5653
- name: Run unit tests
5754
run: go test -v -tags=unit ./...
58-
5955
- name: Run integration tests
6056
env:
6157
ENVIRONMENT: test
62-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
58+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bookreviewapp_test?sslmode=disable
6359
run: go test -v -tags=integration ./...

0 commit comments

Comments
 (0)