aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 756f721a0ddf037ee3915f600c6252446e241ddd (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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Juick

on:
  pull_request:
  push:
    branches: [master]

concurrency: 
  group: ${{ github.head_ref || github.ref }}
  cancel-in-progress: true
  
jobs:
  current:
    runs-on: self-hosted
    timeout-minutes: 15
    services:
      postgres:
        image: postgres
        ports:
          - 5434:5432
        env:
          POSTGRES_DB: juick
          POSTGRES_USER: juick
          POSTGRES_PASSWORD: secret
        options: --health-cmd="pg_isready -U juick" --health-interval=10s --health-retries=3 --health-timeout=5s --health-start-period=15s
      mysql:
        image: mariadb:10.11
        ports:
          - 3306:3306
        env:
          MARIADB_DATABASE: juick
          MARIADB_ROOT_PASSWORD: secret
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-retries=3 --health-timeout=5s --health-start-period=15s
      sqlserver:
        image: mcr.microsoft.com/mssql/server:2022-latest
        ports:
          - 1433:1433
        options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$MSSQL_SA_PASSWORD\" -Q \"SELECT 1\"" --health-interval=10s --health-retries=3 --health-timeout=5s --health-start-period=15s
        env:
          ACCEPT_EULA: Y
          MSSQL_SA_PASSWORD: Passw00rd!
          MSSQL_PID: Express
          MSSQL_COLLATION: Cyrillic_General_100_CI_AS_WS_SC_UTF8
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          distribution: "temurin"
          java-version: 17
      - name: Setup Node.JS 18
        uses: actions/setup-node@v4
        with:
          node-version: "18"
      - run: npm ci
      - name: Run tests (H2)
        run: ./mvnw -Pdefault clean package
      - name: Run tests (PostgreSQL)
        run: ./mvnw -Ppostgres clean package
      - name: Run tests (MySQL)
        run: ./mvnw -Pmysql clean package
      - name: Run tests (SQL Server)
        run: ./mvnw -Psqlserver clean package
      - uses: mikepenz/action-junit-report@v4
        with:
          report_paths: "**/target/surefire-reports/TEST-*.xml"
          github_token: ${{ secrets.GITHUB_TOKEN }}
  vnext:
    runs-on: self-hosted
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4
      - name: Setup Node.JS 18
        uses: actions/setup-node@v4
        with:
          node-version: "18"
      - run: npm ci
      - run: npm run vnext:test
      - run: npm run vnext:lint
      - run: npm run vnext:build
      - run: npm run vnext:build:ssr