aboutsummaryrefslogtreecommitdiff
path: root/.circleci/config.yml
blob: 8a6807f79a7fd4195e85452589d4cf8e8881cfee (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
version: 2
jobs:
  codestyle_and_sql:
    docker:
      - image: trinitycore/circle-ci:3.3.5-buildpacks-focal
        auth:
          username: $DOCKERHUB_USERNAME
          password: $DOCKERHUB_PASSWORD
      - image: circleci/mysql:8
        auth:
          username: $DOCKERHUB_USERNAME
          password: $DOCKERHUB_PASSWORD
        environment:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_ROOT_PASSWORD: ''
          MYSQL_DATABASE: test_mysql
    steps:
      - run:
          name: Checkout
          command: |
            /scripts/checkout.sh
      - run:
          name: Codestyle checks
          command: |
            chmod +x contrib/check_codestyle.sh
            ./contrib/check_codestyle.sh
      - run:
          name: SQL checks
          command: |
            chmod +x contrib/check_updates.sh
            dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
            mysql -h 127.0.0.1 -uroot < sql/create/create_mysql.sql
            mysql -h 127.0.0.1 -uroot auth < sql/base/auth_database.sql
            ./contrib/check_updates.sh auth 3.3.5 auth 127.0.0.1
            mysql -h 127.0.0.1 -uroot characters < sql/base/characters_database.sql
            ./contrib/check_updates.sh characters 3.3.5 characters 127.0.0.1
            mysql -h 127.0.0.1 -uroot world < sql/base/dev/world_database.sql
            cat sql/updates/world/3.3.5/*.sql | mysql -h 127.0.0.1 -uroot world
  pch:
    docker:
      - image: trinitycore/circle-ci:3.3.5-buildpacks-focal
        auth:
          username: $DOCKERHUB_USERNAME
          password: $DOCKERHUB_PASSWORD
    steps:
      - run:
          name: Checkout
          command: |
            /scripts/checkout.sh
      - run:
          name: Setup
          command: |
            mkdir bin
            cd bin
            cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1
            cd ..
      - run:
          name: Build
          command: |
            cd bin
            make -j 4 -k && make install
      - run:
          name: Unit tests
          command: |
            cd bin
            make test
      - run:
          name: Check executables
          command: |
            cd bin/check_install/bin
            ./authserver --version
            ./worldserver --version
  nopch:
    docker:
      - image: trinitycore/circle-ci:3.3.5-buildpacks-focal
        auth:
          username: $DOCKERHUB_USERNAME
          password: $DOCKERHUB_PASSWORD
    steps:
      - run:
          name: Requirements
          command: |
            sudo mkdir -p /root/.ccache
            sudo chown -Rv circleci:circleci /root
      - run:
          name: Checkout
          command: |
            /scripts/checkout.sh
      - restore_cache:
          keys:
            - 3.3.5-nopch-{{ .Branch }}-{{ .Revision }}
            - 3.3.5-nopch-{{ .Branch }}
            - 3.3.5-nopch-3.3.5
      - run:
          name: Setup
          command: |
            export CCACHE_MAXSIZE="1G"
            export CC="ccache clang"
            export CXX="ccache clang++"
            export CCACHE_CPP2=yes
            export USE_CCACHE=1
            export PATH=/usr/lib/ccache:$PATH
            ccache -s
            git config user.email "circleci@build.bot" && git config user.name "Circle CI"
            $CXX --version
            mkdir bin
            cd bin
            cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=0 -DUSE_SCRIPTPCH=0 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
            cd ..
      - run:
          name: Build
          command: |
            cd bin
            make -j 4 -k && make install
            ccache -s
            cd check_install/bin
            ./authserver --version
            ./worldserver --version
      - save_cache:
          key: 3.3.5-nopch-{{ .Branch }}-{{ .Revision }}
          paths:
            - /home/circleci/.ccache
workflows:
  version: 2
  build_all:
    jobs:
      - codestyle_and_sql
      - pch
      - nopch