summaryrefslogtreecommitdiff
path: root/.github/workflows/dashboard-ci.yml
blob: 5901d19447e4ee8092ce75b1dc0ceb4ee9625818 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Dashboard CI
description: |
  This workflow runs tests and builds for the AzerothCore dashboard.
  It includes testing of bash scripts and integration testing of the AzerothCore server.
  Do not remove this if something is broken here and you don't know how to fix it, ping Yehonal instead.

on:
  push:
    branches:
      - 'master'
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
  workflow_dispatch:

concurrency:
  group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
  cancel-in-progress: true

env:
  CONTINUOUS_INTEGRATION: true
  MYSQL_ROOT_PASSWORD: root

jobs:
  test-bash-scripts:
    name: Test Bash Scripts
    strategy:
      fail-fast: true
      matrix:
        include:
          - os: ubuntu-22.04
          - os: ubuntu-24.04
    runs-on: ${{ matrix.os }}
    if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Install requirements
        run: |
          sudo apt-get update
          # Install bats-core >= 1.5.0 to support bats_require_minimum_version
          sudo apt-get install -y git curl
          git clone --depth 1 https://github.com/bats-core/bats-core.git /tmp/bats-core
          sudo /tmp/bats-core/install.sh /usr/local
          bats --version
          ./acore.sh install-deps

      - name: Run bash script tests for ${{ matrix.test-module }}
        env:
          TERM: xterm-256color
        run: |
          cd apps/test-framework
          ./run-tests.sh --tap --all

  build-and-test:
    name: Build and Integration Test
    strategy:
      fail-fast: true
      matrix:
        include:
          - os: ubuntu-22.04
          - os: ubuntu-24.04
    runs-on: ${{ matrix.os }}
    if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Configure AzerothCore settings
        run: |
          # Create basic configuration
          cp conf/dist/config.sh conf/config.sh
          # Configure dashboard
          sed -i 's/MTHREADS=.*/MTHREADS="4"/' conf/config.sh

      - name: Test module commands
        run: |
          ./acore.sh module install mod-autobalance
          ./acore.sh module install mod-duel-reset
          
          ./acore.sh module list

          ./acore.sh module install --all
          ./acore.sh module update mod-autobalance
          ./acore.sh module update --all

      - name: Run complete installation (deps, compile, database, client-data)
        run: |
          # This runs: install-deps, compile, database setup, client-data download
          ./acore.sh init
          sudo npm install -g pm2
        timeout-minutes: 120

      - name: Test module removal
        run: |
          ./acore.sh module remove mod-autobalance
          ./acore.sh module list
          ./acore.sh module remove mod-duel-reset
          ./acore.sh module list

      - name: Test authserver dry-run
        run: |
          cd env/dist/bin
          timeout 5m ./authserver -dry-run
        continue-on-error: false

      - name: Test worldserver dry-run
        run: |
          cd env/dist/bin
          timeout 5m ./worldserver -dry-run
        continue-on-error: false


      - name: Test worldserver with startup scripts
        run: |
          ./acore.sh sm create world worldserver --bin-path ./env/dist/bin --provider pm2
          ./acore.sh sm show-config worldserver
          ./acore.sh sm start worldserver
          ./acore.sh sm wait-uptime worldserver 10 300
          ./acore.sh sm send worldserver "account create tester password 3"
          ./acore.sh sm send worldserver "account set gm tester 3"
          ./acore.sh sm send worldserver "account set addon tester 1"
          ./acore.sh sm wait-uptime worldserver 10 300
          ./acore.sh sm stop worldserver
          ./acore.sh sm delete worldserver
        timeout-minutes: 30
        continue-on-error: false

      - name: Test authserver with startup scripts
        run: |
          ./acore.sh sm create auth authserver --bin-path ./env/dist/bin --provider pm2
          ./acore.sh sm show-config authserver
          ./acore.sh sm start authserver
          ./acore.sh sm wait-uptime authserver 10 300
          ./acore.sh sm stop authserver
          ./acore.sh sm delete authserver
        timeout-minutes: 30
        continue-on-error: false