Files
azerothcore-wotlk/.github/workflows/core_build.yml
Yehonal 380f406248 Feat(Docker/bash): docker-compose system rework (#4488)
## ⚠️ATTENTION! ⚠️ Upgrading procedure:

**Database:** After this PR will be merged you need to backup your DB first (you can use the db-assembler or any mysql client to generate the dump) and restore it after.  The reason is that we use now docker named volumes instead of binded ones to improve performance.

**Conf & client data**: if you use the default configuration, both the etc and the data folder are now available inside the **/env/docker**. 

Finally, you can cleanup the /docker folder previously used by our system.

## Changes Proposed:

This PR will implement the [devcontainer ](https://code.visualstudio.com/docs/remote/containers) feature for VSCode. Allowing us to develop and debug directly within the container in the same way on all OSes.

* Implemented support for vscode dev-container feature by remote-extension suite
* Docker performance optimizations for MacOS and non-linux hosts
* Bash system improvements
* Implemented first command using Deno runtime environment (typescript) and [commander.js]
* Implemented wait mechanism for db_assembler
* Implemented db migration command
* possibility to run the authserver and worldserver with GDB using the integrated simple-restarter
* Implemented docker multi-stage mechanism to use one single Dockerfile for all the services
* client-data downloader now creates a placeholder to avoid downloading the same version of data files multiple times
* deployment of pre-compiled docker images on [docker hub](https://hub.docker.com/u/acore), you can test them [here](https://github.com/azerothcore/acore-docker)
2021-04-22 09:57:05 +02:00

178 lines
5.7 KiB
YAML

name: core-build
on:
push:
branches:
- '**' # matches every branch
- '!coverity_scan' # excludes coverity_scan
pull_request:
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]
modules: [with, without]
extra_logs: [false]
# we can include specific combinations here
include:
- os: ubuntu-20.04
compiler: clang11
modules: without
extra_logs: true
- os: ubuntu-20.04
compiler: clang11
modules: without
extra_logs: false
- os: ubuntu-20.04
compiler: clang9
modules: without
extra_logs: false
- os: ubuntu-18.04
compiler: clang # default in 18.04 is clang 6
modules: without
extra_logs: false
- os: ubuntu-18.04
compiler: gcc8
modules: without
extra_logs: false
- os: ubuntu-20.04
compiler: gcc # default in 20.04 is gcc 9
modules: without
extra_logs: false
- os: ubuntu-20.04
compiler: gcc10
modules: without
extra_logs: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.modules }}-modules-extra_logs-${{ matrix.extra_logs }}
env:
COMPILER: ${{ matrix.compiler }}
EXTRA_LOGS: ${{ matrix.extra_logs }}
if: github.repository == 'azerothcore/azerothcore-wotlk'
steps:
- uses: actions/checkout@v2
- name: Checkout modules
run: ./apps/ci/ci-install-modules.sh
if: matrix.modules == 'with'
- name: Cache
uses: actions/cache@v2
with:
path: /home/runner/.ccache
key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules:${{ github.ref }}
ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules
- name: Configure OS
run: source ./acore.sh install-deps
env:
CONTINUOUS_INTEGRATION: true
- name: Create conf/config.sh
run: source ./apps/ci/ci-conf.sh
- name: Import db
run: source ./apps/ci/ci-import-db.sh
- name: Build
run: source ./apps/ci/ci-compile.sh
- name: Dry run
run: source ./apps/ci/ci-worldserver-dry-run.sh
- 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
mac-build:
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
# - macos-11.0
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}
needs: [build]
if: github.repository == 'azerothcore/azerothcore-wotlk' && success()
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1.1.2
with:
path: ~/.ccache
key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:${{ github.ref }}
ccache:${{ matrix.os }}
- name: Install latest bash
run: brew install bash
- name: Configure OS
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
windows-build:
strategy:
fail-fast: false
runs-on: windows-2019
name: windows-2019-MSVC16
if: github.repository == 'azerothcore/azerothcore-wotlk'
steps:
- uses: actions/checkout@v2
- name: Configure OS
run: choco install --no-progress openssl
- name: Build
shell: bash
run: |
mkdir -p build && cd build
cmake .. -DTOOLS=ON
cmake --build . --config Release --parallel 4
- name: Copy dll files
shell: bash
run: |
cp "/c/mysql-5.7.21-winx64/lib/libmysql.dll" "build/bin/Release/"
cp "/c/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" "build/bin/Release/"
cp "/c/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" "build/bin/Release/"
- uses: actions/upload-artifact@v2
with:
name: windows-2019-MSVC16-release
path: build/bin/Release
docker-build-n-deploy:
strategy:
fail-fast: true
runs-on: ubuntu-20.04
if: github.repository == 'azerothcore/azerothcore-wotlk'
env:
DOCKER_EXTENDS_BIND: abstract-no-bind
DOCKER_BUILD_WORLD_TARGET: worldserver
DOCKER_BUILD_AUTH_TARGET: authserver
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
- name: Configure
run: |
docker --version
docker-compose --version
- name: Build
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker-compose --profile all build
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Deploy
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
if: ${{ steps.extract_branch.outputs.branch == 'master' }}
run: |
docker-compose --profile all push