Skip to content

Commit 739e098

Browse files
committed
Added migration setup to populate cicd test db
1 parent d837945 commit 739e098

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/workflow.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,22 @@ jobs:
4242
uses: actions/setup-go@v5
4343
with:
4444
go-version: 1.22.4
45+
46+
- name: Install golang-migrate
47+
run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
48+
49+
# Run migrations before the tests
50+
- name: Run Migrations
51+
env:
52+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
53+
run: |
54+
migrate -path ./migrations -database $DATABASE_URL up
55+
4556
- name: Run unit tests
4657
run: go test -v -tags=unit ./...
58+
4759
- name: Run integration tests
4860
env:
4961
ENVIRONMENT: test
50-
DATABASE_URL: ${{ vars.DATABASE_URL }}
62+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
5163
run: go test -v -tags=integration ./...

0 commit comments

Comments
 (0)