summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
blob: 2f3a9e825239f371b60942be1ce2dca1758d428e (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build_plugin:
    runs-on: ubuntu-24.04
    permissions:
      contents: read
      pull-requests: write
      issues: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup Development Environment
        uses: jdx/mise-action@v3

      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v5

      - name: Check ktlint
        run: ./gradlew ktlintCheck --no-daemon

      - name: Run tests
        run: ./gradlew test --no-daemon
        continue-on-error: true

      - name: Post test results to PR
        if: github.event_name == 'pull_request' && always()
        env:
          GH_TOKEN: ${{ github.token }}
          GITHUB_REPOSITORY: ${{ github.repository }}
          GITHUB_REF: ${{ github.ref }}
        run: .github/scripts/post-test-results.sh

      - name: Build with shadowJar
        run: ./gradlew :platform-paper:shadowJar :platform-velocity:shadowJar --parallel --no-daemon

      - name: Generate Dokka
        run: ./gradlew :dokka:dokkaGenerate --no-daemon

      - name: Upload build artifacts
        uses: actions/upload-artifact@v6
        if: success()
        with:
          name: LunaticChat-${{ github.sha }}
          path: |
            platform-paper/build/libs/LunaticChat-*.jar
            platform-velocity/build/libs/LunaticChat-*-velocity.jar
          retention-days: 7

  build_docs:
    runs-on: ubuntu-24.04
    defaults:
      run:
        working-directory: "./docs"
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup Development Environment
        uses: jdx/mise-action@v3
        with:
          working_directory: .

      - name: Install dependencies
        run: bun install

      - name: Check formats
        run: bun run format:check

      - name: Check lints
        run: bun run lint

      - name: Build documentation
        run: bun run build