summaryrefslogtreecommitdiffstats
path: root/.github/workflows/sql.yml
blob: c5e4304f8e35774b07950f3b8b6f55cf26037303 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: SQL

on:
  push:
    branches:
      - master
  pull_request: {}

jobs:
  sql:
    name: ${{ matrix.database.name }}
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        database:
          - {type: MYSQL, name: MySQL 5.5,         image: "icinga/icingadb-mysql:5.5"}
          - {type: MYSQL, name: MySQL 5.6,         image: "icinga/icingadb-mysql:5.6"}
          - {type: MYSQL, name: MySQL 5.7,         image: "mysql:5.7"}
          - {type: MYSQL, name: MySQL latest,      image: "mysql:latest"}
          - {type: MYSQL, name: MariaDB 10.1,      image: "mariadb:10.1"}
          - {type: MYSQL, name: MariaDB 10.2,      image: "mariadb:10.2"}
          - {type: MYSQL, name: MariaDB 10.3,      image: "mariadb:10.3"}
          - {type: MYSQL, name: MariaDB 10.4,      image: "mariadb:10.4"}
          - {type: MYSQL, name: MariaDB 10.5,      image: "mariadb:10.5"}
          - {type: MYSQL, name: MariaDB 10.6,      image: "mariadb:10.6"}
          - {type: MYSQL, name: MariaDB 10.7,      image: "mariadb:10.7"}
          - {type: MYSQL, name: MariaDB latest,    image: "mariadb:latest"}
          - {type: PGSQL, name: PostgreSQL 9.6,    image: "postgres:9.6"}
          - {type: PGSQL, name: PostgreSQL 10,     image: "postgres:10"}
          - {type: PGSQL, name: PostgreSQL 11,     image: "postgres:11"}
          - {type: PGSQL, name: PostgreSQL 12,     image: "postgres:12"}
          - {type: PGSQL, name: PostgreSQL 13,     image: "postgres:13"}
          - {type: PGSQL, name: PostgreSQL latest, image: "postgres:latest"}

    steps:
      - name: Setup Go
        uses: actions/setup-go@v1
        with:
          go-version: '^1.16'

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Download dependencies
        run: go get -v -t -d ./...
        working-directory: tests/

      - name: Run tests
        env:
          ICINGADB_TESTS_DATABASE_TYPE: ${{ matrix.database.type }}
          ICINGA_TESTING_${{ matrix.database.type }}_IMAGE: ${{ matrix.database.image }}
          ICINGA_TESTING_ICINGADB_SCHEMA_MYSQL: ${{ github.workspace }}/schema/mysql/schema.sql
          ICINGA_TESTING_ICINGADB_SCHEMA_PGSQL: ${{ github.workspace }}/schema/pgsql/schema.sql
        timeout-minutes: 10
        run: go test -v -timeout 5m ./sql
        working-directory: tests/