9021825f7be1015bb278ce4df4d464830be9c6e7

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

feat(ci): run tests against both sqlite and postgres

Diff

 1diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
 2index 20a7a220d2e44335e183674d628913482b22c0a7..80ec560a3bc14508c60d2749ca5f9a72d424e888 100644
 3--- a/.github/workflows/build.yml
 4+++ b/.github/workflows/build.yml
 5@@ -10,3 +10,33 @@ jobs:
 6     uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
 7     secrets:
 8       goreleaser_key: ${{ secrets.GORELEASER_KEY }}
 9+
10+  test_postgres:
11+    services:
12+      postgres:
13+        image: postgres
14+        ports:
15+          - 5432:5432
16+        env:
17+          POSTGRES_PASSWORD: postgres
18+        options: >-
19+          --health-cmd pg_isready
20+          --health-interval 10s
21+          --health-timeout 5s
22+          --health-retries 5
23+    runs-on: ubuntu-latest
24+    steps:
25+      - name: Checkout code
26+        uses: actions/checkout@v4
27+      - name: Install Go
28+        uses: actions/setup-go@v4
29+        with:
30+          go-version: ^1
31+          cache: true
32+      - name: Download Go modules
33+        run: go mod download
34+      - name: Test
35+        run: go test ./...
36+        env:
37+          DB_DRIVER: postgres
38+          DB_DATA_SOURCE: postgres://postgres:postgres@localhost/postgres?sslmode=disable