From c984991f59e885ae01f49f990b7bcb0e8bbfc540 Mon Sep 17 00:00:00 2001 From: Meltie2013 Date: Fri, 5 Mar 2021 02:26:32 -0600 Subject: [PATCH] Migrate from Travis to GitHub Actions (#140) * Introducing GitHub Actions * Update for Eluna --- .github/workflows/core_build.yml | 77 ++++++++++++++++++++++++++++++++ .travis.sh | 8 ---- .travis.yml | 47 ------------------- apps/ci/ci-compile.sh | 19 ++++++++ apps/ci/ci-submodule-update.sh | 7 +++ 5 files changed, 103 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/core_build.yml delete mode 100755 .travis.sh delete mode 100644 .travis.yml create mode 100644 apps/ci/ci-compile.sh create mode 100644 apps/ci/ci-submodule-update.sh diff --git a/.github/workflows/core_build.yml b/.github/workflows/core_build.yml new file mode 100644 index 00000000..5fb3549b --- /dev/null +++ b/.github/workflows/core_build.yml @@ -0,0 +1,77 @@ +name: core-build +on: + push: + branches: + - github-actions # just for testing and replace with release branch + pull_request: + +jobs: + build: + strategy: + fail-fast: false + + matrix: + compiler: [gcc, clang] + + include: + - os: ubuntu-18.04 + name: Ubuntu 18.04 GCC + compiler: gcc + + - os: ubuntu-18.04 + name: Ubuntu 18.04 Clang + compiler: clang + + runs-on: ${{ matrix.os }} + name: ${{ matrix.name }} + env: + compiler: ${{ matrix.compiler }} + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check for Updates + run: sudo apt-get update -y + + - name: Install Required Packages + run: sudo apt-get install -y git make cmake gcc g++ clang libssl-dev libbz2-dev build-essential default-libmysqlclient-dev libace-6.4.5 libace-dev python + + - name: Check for Submodule Updates + run: source ./apps/ci/ci-submodule-update.sh + + - name: Build Mangos Project + run: source ./apps/ci/ci-compile.sh + + windows-build: + strategy: + fail-fast: false + + runs-on: windows-2019 + name: Windows Server 2019 + + steps: + - uses: actions/checkout@v2 + + - name: Configure Windows + run: choco install --no-progress openssl + + - name: Checkout Submodules + shell: bash + run: | + git submodule init && git submodule update + + - 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/" diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index dc25a4c8..00000000 --- a/.travis.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -if [[ x$OSTYPE =~ ^xdarwin ]]; then - brew update - brew install "mysql" -fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bba4455d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: cpp - -# use docker in travis -sudo: false - -# reduce clone time by only getting the latest commit and not the whole history (default for travis is 100) -git: - depth: 1 - -# only run travis on the master branch -branches: - only: - - master -# send notifications to stack as well as email -notifications: - slack: getmangos:yRgNBSgRQVh8WdfGEbT08Hit - -# build on both Linux and OSX -os: - - linux -# - osx - -# build with both gcc and clang to ensure compatibility -compiler: - - gcc - - clang - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-4.9 - - g++-4.9 - - clang - -before_install: - - bash .travis.sh - - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "gcc" ] ; then export CC=gcc-4.9 CXX=g++-4.9 ; fi - -script: - - test -d _build || mkdir _build - - test -d _install || mkdir _install - - cd _build - - cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DSOAP=1 -DPLAYERBOTS=1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ - - which openssl - - make -j4 diff --git a/apps/ci/ci-compile.sh b/apps/ci/ci-compile.sh new file mode 100644 index 00000000..45c3ce3b --- /dev/null +++ b/apps/ci/ci-compile.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +# Check for & make directories +test -d _build || mkdir _build +test -d _install || mkdir _install + +# Move to build folder +cd _build + +# Run CMake Configurations +cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DSOAP=1 -DPLAYERBOTS=1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ + +# Check OpenSSL +which openssl + +# Compile the Project +make -j 6 diff --git a/apps/ci/ci-submodule-update.sh b/apps/ci/ci-submodule-update.sh new file mode 100644 index 00000000..4ebb10ef --- /dev/null +++ b/apps/ci/ci-submodule-update.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +# Check for Submodule Updates +git submodule init +git submodule update