From e1109672d93f71a0ea861f9871590145e3889458 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 00:09:56 +0700 Subject: [PATCH 01/12] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 00000000000..8a66555a3f8 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,38 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: | + sudo apt update + sudo apt install gcc-8 g++-8 + shell: bash + - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + shell: bash + env: + CC: gcc-8 + CXX: g++-8 + - name: configure + run: ./configure --enable-prere=no --enable-vip=no --enable-buildbot=yes + - name: npc setup + run: ./tools/ci/npc.sh + - name: make clean + run: make clean + - name: make all + run: make all + - name: login server + run: ./login-server --run-once + - name: char server + run: ./char-server --run-once + - name: map server + run: ./map-server --run-once From 2a73c38809de23f4ee55cdace9b1eb44f56dbd1b Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 00:16:19 +0700 Subject: [PATCH 02/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8a66555a3f8..96091c289c4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -17,13 +17,11 @@ jobs: sudo apt update sudo apt install gcc-8 g++-8 shell: bash - - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - shell: bash + - name: configure + run: ./configure --enable-prere=no --enable-vip=no --enable-buildbot=yes env: CC: gcc-8 CXX: g++-8 - - name: configure - run: ./configure --enable-prere=no --enable-vip=no --enable-buildbot=yes - name: npc setup run: ./tools/ci/npc.sh - name: make clean From 3954320c592df8a3c32ea656930d1e9f14d0b3a9 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 00:34:23 +0700 Subject: [PATCH 03/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 96091c289c4..a10fc7a4a62 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -10,6 +10,15 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gcc-8, g++-8] + env: + DB_ROOT: "root" + DB_HOST: "127.0.0.1" + DB_NAME: "ragnarok" + DB_USER: "ragnarok" + DB_PASS: "ragnarok" steps: - uses: actions/checkout@v2 From c47cf8f378f4fae2e46fd929ab6ed4b8f28a46b3 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 00:49:23 +0700 Subject: [PATCH 04/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index a10fc7a4a62..861650c7a4d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -35,8 +35,8 @@ jobs: run: ./tools/ci/npc.sh - name: make clean run: make clean - - name: make all - run: make all + - name: make server + run: make server - name: login server run: ./login-server --run-once - name: char server From bf01773234dd91bb6567b48d39750e0b54219da1 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 01:09:41 +0700 Subject: [PATCH 05/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 861650c7a4d..d8a7393042b 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -10,9 +10,22 @@ jobs: build: runs-on: ubuntu-latest + strategy: matrix: compiler: [gcc-8, g++-8] + + services: + mariadb: + image: mariadb:latest + ports: + - 3306 + env: + MYSQL_USER: "ragnarok" + MYSQL_PASSWORD: "ragnarok" + MYSQL_DATABASE: "ragnarok" + MYSQL_ROOT_PASSWORD: "ragnarok" + env: DB_ROOT: "root" DB_HOST: "127.0.0.1" @@ -22,24 +35,38 @@ jobs: steps: - uses: actions/checkout@v2 + - run: | sudo apt update sudo apt install gcc-8 g++-8 shell: bash + - name: configure run: ./configure --enable-prere=no --enable-vip=no --enable-buildbot=yes env: CC: gcc-8 CXX: g++-8 + - name: npc setup run: ./tools/ci/npc.sh + - name: make clean run: make clean + - name: make server run: make server + + - name: uname -a + run: uname -a + + - name: sql import + run: ./tools/ci/sql.sh + - name: login server run: ./login-server --run-once + - name: char server run: ./char-server --run-once + - name: map server run: ./map-server --run-once From 37106df88d691632109094a664e92d864f76c379 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 01:26:22 +0700 Subject: [PATCH 06/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index d8a7393042b..87e3778b235 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,12 +19,13 @@ jobs: mariadb: image: mariadb:latest ports: - - 3306 + - 3306:3306 env: MYSQL_USER: "ragnarok" MYSQL_PASSWORD: "ragnarok" MYSQL_DATABASE: "ragnarok" MYSQL_ROOT_PASSWORD: "ragnarok" + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=5 env: DB_ROOT: "root" @@ -56,6 +57,10 @@ jobs: - name: make server run: make server + - name: start mysql + - run: | + sudo /etc/init.d/mysql start + - name: uname -a run: uname -a From 5928ec97fe6e2a3ce38441045137e1e15fdb4cce Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 01:34:46 +0700 Subject: [PATCH 07/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 87e3778b235..254e808b452 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,7 +19,7 @@ jobs: mariadb: image: mariadb:latest ports: - - 3306:3306 + - 3306 env: MYSQL_USER: "ragnarok" MYSQL_PASSWORD: "ragnarok" @@ -37,6 +37,16 @@ jobs: steps: - uses: actions/checkout@v2 + - name: start mysql + - run: | + sudo /etc/init.d/mysql start + + - name: uname -a + run: uname -a + + - name: sql import + run: ./tools/ci/sql.sh + - run: | sudo apt update sudo apt install gcc-8 g++-8 @@ -57,16 +67,6 @@ jobs: - name: make server run: make server - - name: start mysql - - run: | - sudo /etc/init.d/mysql start - - - name: uname -a - run: uname -a - - - name: sql import - run: ./tools/ci/sql.sh - - name: login server run: ./login-server --run-once From a574a613099eff445c3d9912d256604e1f106427 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 11 Nov 2021 01:37:52 +0700 Subject: [PATCH 08/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 254e808b452..7f69cf954e9 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,7 +25,6 @@ jobs: MYSQL_PASSWORD: "ragnarok" MYSQL_DATABASE: "ragnarok" MYSQL_ROOT_PASSWORD: "ragnarok" - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=5 env: DB_ROOT: "root" From 3c97cec2a0c7bb7267b66ec43c1f3dd8160e3a09 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 12 Nov 2021 18:11:28 +0700 Subject: [PATCH 09/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7f69cf954e9..edaedcca507 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,6 +25,7 @@ jobs: MYSQL_PASSWORD: "ragnarok" MYSQL_DATABASE: "ragnarok" MYSQL_ROOT_PASSWORD: "ragnarok" + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=5 env: DB_ROOT: "root" @@ -37,7 +38,7 @@ jobs: - uses: actions/checkout@v2 - name: start mysql - - run: | + run: | sudo /etc/init.d/mysql start - name: uname -a From 65d79ff576117d4f3300c2552238067f72c905d6 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 12 Nov 2021 18:18:36 +0700 Subject: [PATCH 10/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index edaedcca507..0d1dac929b8 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -46,6 +46,11 @@ jobs: - name: sql import run: ./tools/ci/sql.sh + env: + DB_ROOT: ${{ env.DB_ROOT }} + DB_NAME: ${{ env.DB_NAME }} + DB_USER: ${{ env.DB_USER }} + DB_PASS: ${{ env.DB_PASS }} - run: | sudo apt update From c2945981d00bef07c42eceba91421a2ed5d44d8c Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 12 Nov 2021 18:23:04 +0700 Subject: [PATCH 11/12] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0d1dac929b8..3486f44ea68 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -21,22 +21,27 @@ jobs: ports: - 3306 env: - MYSQL_USER: "ragnarok" - MYSQL_PASSWORD: "ragnarok" - MYSQL_DATABASE: "ragnarok" - MYSQL_ROOT_PASSWORD: "ragnarok" + MYSQL_USER: ragnarok + MYSQL_PASSWORD: ragnarok + MYSQL_DATABASE: ragnarok + MYSQL_ROOT_PASSWORD: ragnarok options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=5 env: - DB_ROOT: "root" - DB_HOST: "127.0.0.1" - DB_NAME: "ragnarok" - DB_USER: "ragnarok" - DB_PASS: "ragnarok" + DB_ROOT: root + DB_HOST: 127.0.0.1 + DB_NAME: ragnarok + DB_USER: ragnarok + DB_PASS: ragnarok steps: - uses: actions/checkout@v2 + - run: | + sudo apt update + sudo apt install gcc-8 g++-8 + shell: bash + - name: start mysql run: | sudo /etc/init.d/mysql start @@ -52,11 +57,6 @@ jobs: DB_USER: ${{ env.DB_USER }} DB_PASS: ${{ env.DB_PASS }} - - run: | - sudo apt update - sudo apt install gcc-8 g++-8 - shell: bash - - name: configure run: ./configure --enable-prere=no --enable-vip=no --enable-buildbot=yes env: From 447a07f3284564ca35e00cb44768cd4c6ec51837 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 12 Nov 2021 18:27:50 +0700 Subject: [PATCH 12/12] Update sql.sh --- tools/ci/sql.sh | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/ci/sql.sh b/tools/ci/sql.sh index d0f0918c91b..0339e3b9709 100755 --- a/tools/ci/sql.sh +++ b/tools/ci/sql.sh @@ -5,28 +5,28 @@ function aborterror { exit 1 } -mysql -u $DB_ROOT -e "CREATE DATABASE $DB_NAME;" || aborterror "Unable to create database." -mysql -u $DB_ROOT $DB_NAME < sql-files/main.sql || aborterror "Unable to import main database." -mysql -u $DB_ROOT $DB_NAME < sql-files/logs.sql || aborterror "Unable to import logs database." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db.sql || aborterror "Unable to import cash item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db2.sql || aborterror "Unable to import cash item 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db.sql || aborterror "Unable to import pre-renewal item table structure." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_usable.sql || aborterror "Unable to import pre-renewal usable item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_equip.sql || aborterror "Unable to import pre-renewal equip item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_etc.sql || aborterror "Unable to import pre-renewal etc item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2.sql || aborterror "Unable to import pre-renewal item 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re.sql || aborterror "Unable to import renewal item table structure." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_usable.sql || aborterror "Unable to import renewal usable item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_equip.sql || aborterror "Unable to import renewal equip item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_etc.sql || aborterror "Unable to import renewal etc item table." -mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2_re.sql || aborterror "Unable to import renewal item 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db.sql || aborterror "Unable to import pre-renewal monster table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db2.sql || aborterror "Unable to import pre-renewal monster 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db_re.sql || aborterror "Unable to import renewal monster table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db2_re.sql || aborterror "Unable to import renewal monster 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db.sql || aborterror "Unable to import pre-renewal monster skill table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2.sql || aborterror "Unable to import pre-renewal monster skill 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db_re.sql || aborterror "Unable to import renewal monster skill table." -mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2_re.sql || aborterror "Unable to import renewal monster skill 2 table." -mysql -u $DB_ROOT $DB_NAME < sql-files/roulette_default_data.sql || aborterror "Unable to import roulette table." -mysql -u $DB_ROOT -e "GRANT SELECT,INSERT,UPDATE,DELETE ON $DB_NAME.* TO '$DB_USER'@'$DB_HOST' IDENTIFIED BY '$DB_PASS';" +mysql -h 127.0.0.1 -u $DB_ROOT -e "CREATE DATABASE $DB_NAME;" || aborterror "Unable to create database $DB_NAME." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/main.sql || aborterror "Unable to import main database." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/logs.sql || aborterror "Unable to import logs database." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_cash_db.sql || aborterror "Unable to import cash item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_cash_db2.sql || aborterror "Unable to import cash item 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db.sql || aborterror "Unable to import pre-renewal item table structure." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_usable.sql || aborterror "Unable to import pre-renewal usable item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_equip.sql || aborterror "Unable to import pre-renewal equip item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_etc.sql || aborterror "Unable to import pre-renewal etc item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db2.sql || aborterror "Unable to import pre-renewal item 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_re.sql || aborterror "Unable to import renewal item table structure." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_re_usable.sql || aborterror "Unable to import renewal usable item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_re_equip.sql || aborterror "Unable to import renewal equip item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db_re_etc.sql || aborterror "Unable to import renewal etc item table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/item_db2_re.sql || aborterror "Unable to import renewal item 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_db.sql || aborterror "Unable to import pre-renewal monster table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_db2.sql || aborterror "Unable to import pre-renewal monster 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_db_re.sql || aborterror "Unable to import renewal monster table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_db2_re.sql || aborterror "Unable to import renewal monster 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db.sql || aborterror "Unable to import pre-renewal monster skill table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2.sql || aborterror "Unable to import pre-renewal monster skill 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db_re.sql || aborterror "Unable to import renewal monster skill table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2_re.sql || aborterror "Unable to import renewal monster skill 2 table." +mysql -h 127.0.0.1 -u $DB_ROOT $DB_NAME < sql-files/roulette_default_data.sql || aborterror "Unable to import roulette table." +mysql -h 127.0.0.1 -u $DB_ROOT -e "GRANT SELECT,INSERT,UPDATE,DELETE ON $DB_NAME.* TO '$DB_USER'@'$DB_HOST' IDENTIFIED BY '$DB_PASS';"