aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: 8476a1915bbc3479cfb72c7244b3674dc11c9620 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Test

on:
  push:
    branches: ["main", "dev"]
  pull_request:
    branches: ["main", "dev"]

jobs:
  run-tests:
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        db:
          - {name: postgresql}
          - {name: mysql}
          - {name: mssql}
          - {name: sqlite3}
    steps:
    - name: Checkout Source Code
      uses: actions/checkout@v4
    - name: Start Database
      if: matrix.db.name != 'sqlite3'
      run: |
        env $(cat ".env.${{ matrix.db.name }}" | xargs) docker compose -f "docker-compose.${{ matrix.db.name }}.yml" up -d
    - name: Run Tests
      run: env $(cat ".env.${{ matrix.db.name }}" | xargs) go test -p 1 -tags "${{ matrix.db.name }}" -cover ./...