diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index bf27375e3b..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,162 +0,0 @@ -version: 2 -jobs: - codestyle_and_sql: - docker: - - image: cataclysmpreservationproject/circle-ci:master-base-22.04 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - - image: cimg/mysql:8.0 - 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 4.3.4 auth 127.0.0.1 - mysql -h 127.0.0.1 -uroot characters < sql/base/characters_database.sql - ./contrib/check_updates.sh characters 4.3.4 characters 127.0.0.1 - echo "Importing world database structure" - mysql -h 127.0.0.1 -uroot world < sql/base/dev/world_database.sql - echo "Importing hotfixes database structure" - mysql -h 127.0.0.1 -uroot hotfixes < sql/base/dev/hotfixes_database.sql - echo "Importing world database updates" - cat sql/updates/world/4.3.4/*.sql | mysql -h 127.0.0.1 -uroot world - echo "Importing hotfixes database updates" - cat sql/updates/hotfixes/4.3.4/*.sql | mysql -h 127.0.0.1 -uroot hotfixes - pch: - docker: - - image: cataclysmpreservationproject/circle-ci:master-base-22.04 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - steps: - - run: - name: Checkout - command: | - /scripts/checkout.sh - - run: - name: Setup - command: | - mkdir bin - cd bin - if [ "$DOCKERHUB_PUSH_IMAGES" == "TRUE" ]; then - cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_INSTALL_PREFIX=check_install -DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib -DBUILD_TESTING=1 - else - cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -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 -DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib -DBUILD_TESTING=1 - fi - 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 - ./bnetserver --version - ./worldserver --version - - setup_remote_docker: - version: 19.03.13 - - run: - name: Create docker images - command: | - cd bin/check_install - cp -r ../../contrib/Docker/* . - cp -r ../../sql ./sql - image_prefix=$(echo cataclysmpreservationproject/$CIRCLE_PROJECT_REPONAME | tr '[:upper:]' '[:lower:]') - echo $image_prefix - docker build --file Dockerfile --force-rm --tag $image_prefix:$CIRCLE_SHA1 --tag $image_prefix:$(echo $CIRCLE_BRANCH | tr '/' '-' | tr '[:upper:]' '[:lower:]') . - docker save $image_prefix | gzip > ../../docker.tar.gz - if [ "$DOCKERHUB_PUSH_IMAGES" == "TRUE" ]; then - if [ "$CIRCLE_BRANCH" == "master" ]; then - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - echo "Pushing docker image to dockerhub" - docker push --all-tags $image_prefix - fi - fi - - store_artifacts: - path: docker.tar.gz - nopch: - docker: - - image: cataclysmpreservationproject/circle-ci:master-base-22.04 - 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: - - master-nopch-{{ .Branch }}-{{ .Revision }} - - master-nopch-{{ .Branch }} - - master-nopch-master - - 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 - export CCACHE_DIR=$HOME/.ccache - ccache -z - 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 - ./bnetserver --version - ./worldserver --version - - save_cache: - key: master-nopch-{{ .Branch }}-{{ .Revision }} - paths: - - /home/circleci/.ccache -workflows: - version: 2 - build_all: - jobs: - - codestyle_and_sql - - pch - - nopch diff --git a/.github/workflows/clang-build.yml b/.github/workflows/clang-build.yml new file mode 100644 index 0000000000..afb8a74f74 --- /dev/null +++ b/.github/workflows/clang-build.yml @@ -0,0 +1,34 @@ +name: clang PCH + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + - name: Dependencies + run: | + sudo apt-get update && sudo apt-get install -yq libboost-all-dev clang-11 + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-11 100 --slave /usr/bin/c++ c++ /usr/bin/clang++-11 + - name: Setup + run: | + mkdir bin + cd bin + cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 -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=0 + cd .. + - name: Build + run: | + cd bin + make -j 4 -k && make install + - name: Unit tests + run: | + cd bin + make test + - name: Check executables + run: | + cd bin/check_install/bin + ./authserver --version + ./worldserver --version diff --git a/.github/workflows/gcc-build.yml b/.github/workflows/gcc-build.yml index 5aff98d195..cd2c0ba70f 100644 --- a/.github/workflows/gcc-build.yml +++ b/.github/workflows/gcc-build.yml @@ -1,4 +1,4 @@ -name: GCC +name: GCC PCH on: push: @@ -31,5 +31,4 @@ jobs: run: | cd bin/check_install/bin ./authserver --version - ./bnetserver --version - ./worldserver --version \ No newline at end of file + ./worldserver --version