Migrate from Travis to GitHub Actions (#140)

* Introducing GitHub Actions

* Update for Eluna
This commit is contained in:
Meltie2013 2021-03-05 02:26:32 -06:00 committed by GitHub
parent 8f017ecd2e
commit c984991f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 103 additions and 55 deletions

77
.github/workflows/core_build.yml vendored Normal file
View File

@ -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/"

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -eu
if [[ x$OSTYPE =~ ^xdarwin ]]; then
brew update
brew install "mysql"
fi

View File

@ -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

19
apps/ci/ci-compile.sh Normal file
View File

@ -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

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
# Check for Submodule Updates
git submodule init
git submodule update