Skip to content

Commit

Permalink
Update tests.yaml to introduce testing matrix
Browse files Browse the repository at this point in the history
This commit introduces a matrix strategy in the GitHub workflow for testing multiple combinations of Go and PostgreSQL versions. This change allows us to ensure compatibility with a range of versions of our dependencies.
  • Loading branch information
Tomas Prochazka committed Oct 1, 2023
1 parent 178a0fa commit 00c46e2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ jobs:
# This workflow contains a single job called "test"
test:
name: test
strategy:
matrix:
# version must be string, otherwise it will be converted to float
# and the trailing zero will be removed. 1.20 -> 1.2
go-version: [ "1.21" ]
postgres-version: [ 16, 15, 14, 13, 12, 11 ]

# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -30,7 +37,7 @@ jobs:
services:
# Start the postgres database
postgres:
image: postgres:15
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -54,7 +61,7 @@ jobs:
- name: setup go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: ${{ matrix.go-version }}

# Cache Go build cache and modcache
- name: cache deps
Expand Down

0 comments on commit 00c46e2

Please sign in to comment.