From 4a25ac665de88f6944cc5f2df6d0a5a043866113 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sun, 26 Nov 2023 17:27:40 +0100 Subject: [PATCH] chore(CI): Make some changes (#17861) * chore(CI): Make some changes. Less CI's maybe better... * pendingsql * FORK TEST - TO BE REVERTED * changes * test * fix * Revert "FORK TEST - TO BE REVERTED" This reverts commit 875bc281c5a355cce2ddd8015484e256dbc185cf. * rename workflow * rename workflow * rename workflow * rename workflow * I argue windows don't need dry runs * maybe mac wants to be alive. who knows. When do we drop mac support really...? --- .github/workflows/build_dbimport.yml | 49 ------------- .github/workflows/codestyle.yml | 5 +- ..._matrix_build.yml => core-build-nopch.yml} | 17 +---- .../{core_build.yml => core-build-pch.yml} | 10 +-- .github/workflows/core_modules_build.yml | 8 --- .github/workflows/cpp-check.yml | 7 -- .github/workflows/macos_build.yml | 3 - ...heck_pending_sql.yml => sql-codestyle.yml} | 5 +- .github/workflows/tools_build.yml | 7 +- .github/workflows/windows_build.yml | 21 ------ apps/ci/ci-conf-core-pch.sh | 69 +++++++++++++++++++ apps/installer/includes/os_configs/osx.sh | 2 +- 12 files changed, 88 insertions(+), 115 deletions(-) delete mode 100644 .github/workflows/build_dbimport.yml rename .github/workflows/{core_matrix_build.yml => core-build-nopch.yml} (75%) rename .github/workflows/{core_build.yml => core-build-pch.yml} (88%) rename .github/workflows/{check_pending_sql.yml => sql-codestyle.yml} (83%) create mode 100644 apps/ci/ci-conf-core-pch.sh diff --git a/.github/workflows/build_dbimport.yml b/.github/workflows/build_dbimport.yml deleted file mode 100644 index ecc4068d1..000000000 --- a/.github/workflows/build_dbimport.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: build-db -on: - push: - branches: - - 'master' # only default branch - pull_request: - -concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) - cancel-in-progress: true - -jobs: - build: - strategy: - fail-fast: false - matrix: - # the result of the matrix will be the combination of all attributes, so we get os*compiler*modules builds - os: [ubuntu-20.04] - compiler: [clang] - runs-on: ${{ matrix.os }} - name: ${{ matrix.compiler }} - env: - COMPILER: ${{ matrix.compiler }} - if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft - steps: - - uses: actions/checkout@v4 - - name: Cache - uses: actions/cache@v3 - env: - cache-name: cache-db - with: - path: var/ccache - key: ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.sha }} - restore-keys: | - ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}- - ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}- - ${{ env.cache-name }}-${{ matrix.os }}- - - name: Configure OS - run: source ./acore.sh install-deps - env: - CONTINUOUS_INTEGRATION: true - - name: Create conf/config.sh - run: source ./apps/ci/ci-conf-db.sh - - name: Build - run: source ./apps/ci/ci-compile.sh - - name: Process pending sql - run: bash bin/acore-db-pendings - - name: Dry run - run: source ./apps/ci/ci-dry-run.sh dbimport diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index acce90c0d..e56b1de2b 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -1,16 +1,15 @@ -name: check-codestyle +name: Codestyle on: pull_request: jobs: - check-codestyle: + triage: strategy: fail-fast: false matrix: os: [ubuntu-20.04] runs-on: ${{ matrix.os }} if: github.repository == 'azerothcore/azerothcore-wotlk' - name: check codestyle steps: - uses: actions/checkout@v4 - name: Check core codestyle diff --git a/.github/workflows/core_matrix_build.yml b/.github/workflows/core-build-nopch.yml similarity index 75% rename from .github/workflows/core_matrix_build.yml rename to .github/workflows/core-build-nopch.yml index 76ae747e3..cff8820de 100644 --- a/.github/workflows/core_matrix_build.yml +++ b/.github/workflows/core-build-nopch.yml @@ -1,4 +1,4 @@ -name: core +name: nopch-build on: push: branches: @@ -19,26 +19,13 @@ jobs: include: - os: ubuntu-20.04 compiler: clang12 - - os: ubuntu-20.04 - compiler: clang11 - - os: ubuntu-20.04 - compiler: gcc # default in 20.04 is gcc 9 - os: ubuntu-20.04 compiler: gcc10 runs-on: ${{ matrix.os }} name: ${{ matrix.os }}-${{ matrix.compiler }} env: COMPILER: ${{ matrix.compiler }} - if: | - github.repository == 'azerothcore/azerothcore-wotlk' - && !github.event.pull_request.draft - && ( - github.ref == 'refs/heads/master' - || contains(github.event.pull_request.labels.*.name, 'file-cpp' - || github.event.label.name == 'file-cpp' - || contains(github.event.pull_request.labels.*.name, 'run-build') - || github.event.label.name == 'run-build') - ) + if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft steps: - uses: actions/checkout@v4 - name: Cache diff --git a/.github/workflows/core_build.yml b/.github/workflows/core-build-pch.yml similarity index 88% rename from .github/workflows/core_build.yml rename to .github/workflows/core-build-pch.yml index c64f7178d..75862f0ff 100644 --- a/.github/workflows/core_build.yml +++ b/.github/workflows/core-build-pch.yml @@ -1,9 +1,10 @@ -name: main +name: pch-build on: push: branches: - 'master' pull_request: + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) @@ -15,8 +16,9 @@ jobs: fail-fast: false matrix: # the result of the matrix will be the combination of all attributes, so we get os*compiler builds - os: [ubuntu-20.04] - compiler: [clang] + include: + - os: ubuntu-20.04 + compiler: clang12 runs-on: ${{ matrix.os }} name: ${{ matrix.os }}-${{ matrix.compiler }} env: @@ -37,7 +39,7 @@ jobs: env: CONTINUOUS_INTEGRATION: true - name: Create conf/config.sh - run: source ./apps/ci/ci-conf-core.sh + run: source ./apps/ci/ci-conf-core-pch.sh - name: Process pending sql run: bash bin/acore-db-pendings - name: Build diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index 586edcfa4..a465e589f 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -28,8 +28,6 @@ jobs: && !github.event.pull_request.draft && ( github.ref == 'refs/heads/master' - || contains(github.event.pull_request.labels.*.name, 'file-cpp' - || github.event.label.name == 'file-cpp' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') ) @@ -56,9 +54,3 @@ jobs: run: bash bin/acore-db-pendings - name: Build run: source ./apps/ci/ci-compile.sh - - name: Dry run - run: source ./apps/ci/ci-dry-run.sh worldserver - - name: Check startup errors - run: source ./apps/ci/ci-error-check.sh - - name: Run unit tests - run: source ./apps/ci/ci-run-unit-tests.sh diff --git a/.github/workflows/cpp-check.yml b/.github/workflows/cpp-check.yml index ea1f7adbb..1b1a0ff28 100644 --- a/.github/workflows/cpp-check.yml +++ b/.github/workflows/cpp-check.yml @@ -1,12 +1,5 @@ name: cpp-check on: - push: - branches: - - "master" - paths: - - src/** - - "!README.md" - - "!docs/**" pull_request: paths: - src/** diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 46e3a9618..2e756dc1b 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -16,7 +16,6 @@ jobs: fail-fast: false matrix: os: - - macos-11 - macos-12 runs-on: ${{ matrix.os }} name: ${{ matrix.os }} @@ -40,5 +39,3 @@ jobs: run: source ./acore.sh install-deps - name: Build run: source ./apps/ci/mac/ci-compile.sh - - name: Run unit tests - run: source ./apps/ci/ci-run-unit-tests.sh diff --git a/.github/workflows/check_pending_sql.yml b/.github/workflows/sql-codestyle.yml similarity index 83% rename from .github/workflows/check_pending_sql.yml rename to .github/workflows/sql-codestyle.yml index 52ea18acb..9149fbb69 100644 --- a/.github/workflows/check_pending_sql.yml +++ b/.github/workflows/sql-codestyle.yml @@ -1,9 +1,8 @@ -name: Check pending SQL +name: SQL Codestyle on: pull_request: - jobs: - check-pending-sql: + triage: runs-on: ubuntu-latest if: github.repository == 'azerothcore/azerothcore-wotlk' steps: diff --git a/.github/workflows/tools_build.yml b/.github/workflows/tools_build.yml index 6044cc036..51091736d 100644 --- a/.github/workflows/tools_build.yml +++ b/.github/workflows/tools_build.yml @@ -21,7 +21,12 @@ jobs: name: ${{ matrix.os }}-${{ matrix.compiler }} env: COMPILER: ${{ matrix.compiler }} - if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft + if: | + github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft + && ( + contains(github.event.pull_request.labels.*.name, 'run-build') + || github.event.label.name == 'run-build') + ) steps: - uses: actions/checkout@v4 - name: Cache diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 76d78e7e0..61a3862ca 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -34,29 +34,8 @@ jobs: CONTINUOUS_INTEGRATION: true run: | ./acore.sh install-deps - - name: Process pending sql - shell: bash - run: bash bin/acore-db-pendings - name: Build shell: bash run: | export CTOOLS_BUILD=all ./acore.sh compiler build - - name: Copy dll files - shell: bash - run: | - cp "/c/Program Files/OpenSSL/bin/legacy.dll" "env/dist" - - name: Dry run authserver - shell: bash - run: | - source ./apps/ci/ci-gen-server-conf-files.sh "authserver" "configs" "." - cd env/dist - ./authserver -dry-run - - name: Dry run worldserver - shell: bash - run: | - source ./apps/ci/ci-gen-server-conf-files.sh "worldserver" "configs" "." - cd env/dist - ./worldserver -dry-run - - name: Stop MySQL - run: net stop mysql diff --git a/apps/ci/ci-conf-core-pch.sh b/apps/ci/ci-conf-core-pch.sh new file mode 100644 index 000000000..106b3e0be --- /dev/null +++ b/apps/ci/ci-conf-core-pch.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +set -e + +cat >>conf/config.sh <> ./conf/config.sh + echo "CCOMPILERCXX=\"g++\"" >> ./conf/config.sh + ;; + + "gcc8" ) + time sudo apt-get install -y gcc-8 g++-8 + echo "CCOMPILERC=\"gcc-8\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"g++-8\"" >> ./conf/config.sh + ;; + + "gcc10" ) + time sudo apt-get install -y gcc-10 g++-10 + echo "CCOMPILERC=\"gcc-10\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"g++-10\"" >> ./conf/config.sh + ;; + + # this is in order to use the "default" clang version of the OS, without forcing a specific version + "clang" ) + time sudo apt-get install -y clang + echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh + ;; + + "clang10" ) + time sudo apt-get install -y clang-10 + echo "CCOMPILERC=\"clang-10\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++-10\"" >> ./conf/config.sh + ;; + + "clang11" ) + time sudo apt-get install -y clang-11 + echo "CCOMPILERC=\"clang-11\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh + ;; + + "clang12" ) + time sudo apt-get install -y clang-12 + echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh + ;; + + * ) + echo "Unknown compiler $COMPILER" + exit 1 + ;; +esac diff --git a/apps/installer/includes/os_configs/osx.sh b/apps/installer/includes/os_configs/osx.sh index 7088f0d58..131efd466 100644 --- a/apps/installer/includes/os_configs/osx.sh +++ b/apps/installer/includes/os_configs/osx.sh @@ -26,4 +26,4 @@ if ! command -v cmake &>/dev/null ; then fi ########################################## -brew install openssl@3 readline boost@1.76 bash-completion curl unzip mysql@8.1 ccache +brew install openssl@3 readline boost bash-completion curl unzip mysql@8.1 ccache