aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 3e4a1cdf4420ece7fe780fc05f15370184e181e5 (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
name: Java CI

on:
  pull_request:
  push:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        profile: [default, postgres, mysql]
    name: OpenJDK
    services:
      postgres:
        image: postgres
        ports:
          - 5432: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
        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
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 19
        uses: actions/setup-java@v3
        with:
          distribution: "temurin"
          java-version: 19
          cache: "maven"
      - name: Setup Node.JS 18
        uses: actions/setup-node@v3
        with:
          node-version: "18"
          cache: "npm"
      - run: npm install
      - name: Run tests
        run: mvn -P${{ matrix.profile }} clean package
      - uses: mikepenz/action-junit-report@v2
        with:
          report_paths: "**/target/surefire-reports/TEST-*.xml"
          github_token: ${{ secrets.GITHUB_TOKEN }}