From d89c12eab5292cbf580fcd3ff012c6eae718d66b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 1 Nov 2020 17:41:43 +0100 Subject: [PATCH] [MIRROR] Completely replace Travis and AppVeyor with GitHub Actions (#1519) * Completely replace Travis and AppVeyor with GitHub Actions * Delete .travis.yml Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com> Co-authored-by: Gandalf --- .dockerignore | 2 - .github/workflows/generate_documentation.yml | 30 +++++ .github/workflows/test.yml | 100 +++++++++++++++++ .travis.yml | 103 ------------------ _maps/_basemap.dm | 2 +- appveyor.yml | 15 --- code/_compile_options.dm | 4 +- .../research/designs/medical_designs.dm | 2 +- tools/{appveyor => ci}/build.ps1 | 6 +- tools/{travis => ci}/build_spaceman_dmm.sh | 0 tools/{travis => ci}/build_tgui.sh | 0 tools/{travis => ci}/check_changelogs.sh | 0 tools/{travis => ci}/check_filedirs.sh | 0 tools/{travis => ci}/check_grep.sh | 0 .../travis_config.txt => ci/ci_config.txt} | 2 +- tools/{travis => ci}/dm.sh | 0 tools/{appveyor => ci}/download_byond.sh | 0 tools/{travis => ci}/install_build_tools.sh | 2 - tools/{travis => ci}/install_byond.sh | 0 tools/{travis => ci}/install_rust_g.sh | 0 tools/{travis => ci}/install_spaceman_dmm.sh | 0 tools/ci/run_server.sh | 14 +++ tools/{travis => ci}/template_dm_generator.py | 0 tools/travis/run_server.sh | 14 --- 24 files changed, 151 insertions(+), 145 deletions(-) create mode 100644 .github/workflows/generate_documentation.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml rename tools/{appveyor => ci}/build.ps1 (66%) rename tools/{travis => ci}/build_spaceman_dmm.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/build_tgui.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/check_changelogs.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/check_filedirs.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/check_grep.sh (100%) mode change 100755 => 100644 rename tools/{travis/travis_config.txt => ci/ci_config.txt} (82%) rename tools/{travis => ci}/dm.sh (100%) mode change 100755 => 100644 rename tools/{appveyor => ci}/download_byond.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/install_build_tools.sh (88%) mode change 100755 => 100644 rename tools/{travis => ci}/install_byond.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/install_rust_g.sh (100%) mode change 100755 => 100644 rename tools/{travis => ci}/install_spaceman_dmm.sh (100%) mode change 100755 => 100644 create mode 100644 tools/ci/run_server.sh rename tools/{travis => ci}/template_dm_generator.py (100%) mode change 100755 => 100644 delete mode 100755 tools/travis/run_server.sh diff --git a/.dockerignore b/.dockerignore index 2e6259d23d6..9c6ac6b4aa6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ .dockerignore .editorconfig -.travis.yml GPLv3.txt LICENSE README.md @@ -26,5 +25,4 @@ tgstation.dyn.rsc libmariadb.dll rust_g.dll BSQL.dll -appveyor.yml Dockerfile diff --git a/.github/workflows/generate_documentation.yml b/.github/workflows/generate_documentation.yml new file mode 100644 index 00000000000..9407693d4fe --- /dev/null +++ b/.github/workflows/generate_documentation.yml @@ -0,0 +1,30 @@ +name: Generate documentation +on: + push: + branches: + - master +jobs: + generate_documentation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup cache + uses: actions/cache@v2 + with: + path: $HOME/SpacemanDMM + key: ${{ runner.os }}-spacemandmm + - name: Install SpacemanDMM + run: bash tools/ci/install_spaceman_dmm.sh dmdoc + - name: Generate documentation + run: | + ~/dmdoc + touch dmdoc/.nojekyll + echo codedocs.tgstation13.org > dmdoc/CNAME + - name: Deploy + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + BRANCH: gh-pages + CLEAN: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SINGLE_COMMIT: true + FOLDER: dmdoc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..5c9a5583d28 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,100 @@ +name: Run tests +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + run_linters: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup cache + uses: actions/cache@v2 + with: + path: $HOME/SpacemanDMM + key: ${{ runner.os }}-spacemandmm + - name: Install Tools + run: | + pip3 install setuptools + bash tools/ci/install_build_tools.sh + bash tools/ci/install_spaceman_dmm.sh dreamchecker + pip3 install -r tools/mapmerge2/requirements.txt + - name: Run Linters + run: | + bash tools/ci/check_filedirs.sh tgstation.dme + bash tools/ci/check_changelogs.sh + find . -name "*.php" -print0 | xargs -0 -n1 php -l + find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py + bash tools/ci/build_tgui.sh + bash tools/ci/check_grep.sh + python3 tools/mapmerge2/dmi.py --test + ~/dreamchecker + compile_all_maps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup cache + uses: actions/cache@v2 + with: + path: $HOME/BYOND + key: ${{ runner.os }}-byond + - name: Compile All Maps + run: | + bash tools/ci/install_byond.sh + source $HOME/BYOND/byond/bin/byondsetup + python3 tools/ci/template_dm_generator.py + bash tools/ci/dm.sh -DCIBUILDING -DCITESTING -DALL_MAPS tgstation.dme + run_all_tests: + runs-on: ubuntu-latest + services: + mysql: + image: mysql:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v2 + - name: Setup cache + uses: actions/cache@v2 + with: + path: $HOME/BYOND + key: ${{ runner.os }}-byond + - name: Setup database + run: | + sudo systemctl start mysql + mysql -u root -proot -e 'CREATE DATABASE tg_ci;' + mysql -u root -proot tg_ci < SQL/tgstation_schema.sql + mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;' + mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql + - name: Install rust-g + run: | + sudo dpkg --add-architecture i386 + sudo apt update + sudo apt install libssl1.1:i386 + bash tools/ci/install_rust_g.sh + - name: Compile and run tests + run: | + bash tools/ci/install_byond.sh + source $HOME/BYOND/byond/bin/byondsetup + bash tools/ci/dm.sh -DCIBUILDING tgstation.dme + bash tools/ci/run_server.sh + test_windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Compile + run: pwsh tools/ci/build.ps1 + - name: Create artifact + run: | + md deploy + bash tools/deploy.sh ./deploy + - name: Deploy artifact + uses: actions/upload-artifact@v2 + with: + name: deploy + path: deploy diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 59783840ce9..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,103 +0,0 @@ -language: generic -os: linux -dist: bionic - -branches: - except: - - ___TGS3TempBranch - - ___TGSTempBranch - -jobs: - include: - - name: "Run Linters" - addons: - apt: - packages: - - python3 - - python3-pip - - python3-setuptools - - pcregrep - - rustc - - cargo - cache: - directories: - - $HOME/SpacemanDMM - install: - - tools/travis/install_build_tools.sh - - tools/travis/install_spaceman_dmm.sh dreamchecker - - python3 -m pip install -r tools/mapmerge2/requirements.txt - script: - - tools/travis/check_filedirs.sh tgstation.dme - - tools/travis/check_changelogs.sh - - find . -name "*.php" -print0 | xargs -0 -n1 php -l - - find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py - - tools/travis/build_tgui.sh - - tools/travis/check_grep.sh - - python3 tools/mapmerge2/dmi.py --test - - ~/dreamchecker - - - name: "Compile All Maps" - addons: - apt: - packages: - - libstdc++6:i386 - cache: - directories: - - $HOME/BYOND - install: - - tools/travis/install_byond.sh - - source $HOME/BYOND/byond/bin/byondsetup - before_script: - - tools/travis/template_dm_generator.py - script: - - tools/travis/dm.sh -DTRAVISBUILDING -DTRAVISTESTING -DALL_MAPS tgstation.dme - - - name: "Compile and Run Tests" - addons: - mariadb: '10.2' - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - libstdc++6:i386 - - gcc-multilib - - g++-7 - - g++-7-multilib - - libssl1.1:i386 - - zlib1g:i386 - cache: - directories: - - $HOME/BYOND - install: - - tools/travis/install_byond.sh - - source $HOME/BYOND/byond/bin/byondsetup - - tools/travis/install_rust_g.sh - before_script: - - mysql -u root -e 'CREATE DATABASE tg_travis;' - - mysql -u root tg_travis < SQL/tgstation_schema.sql - - mysql -u root -e 'CREATE DATABASE tg_travis_prefixed;' - - mysql -u root tg_travis_prefixed < SQL/tgstation_schema_prefixed.sql - script: - - tools/travis/dm.sh -DTRAVISBUILDING tgstation.dme || travis_terminate 1 - - tools/travis/run_server.sh - - - name: "Generate Documentation" - # Only run for non-PR commits to the real master branch. - if: branch = master AND head_branch IS blank - cache: - directories: - - $HOME/SpacemanDMM - install: - - tools/travis/install_spaceman_dmm.sh dmdoc - before_script: - # Travis checks out a hash, try to get back on a branch. - - git checkout $TRAVIS_BRANCH || true - script: - - ~/dmdoc - - touch dmdoc/.nojekyll - deploy: - provider: pages - skip_cleanup: true - local_dir: dmdoc - token: $DMDOC_GITHUB_TOKEN - fqdn: skyrat-ss13.github.io diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm index c15ba40826f..14fd56e2430 100644 --- a/_maps/_basemap.dm +++ b/_maps/_basemap.dm @@ -12,7 +12,7 @@ #include "map_files\PubbyStation\PubbyStation.dmm" #include "map_files\IceBoxStation\IceBoxStation.dmm" - #ifdef TRAVISBUILDING + #ifdef CIBUILDING #include "templates.dm" #endif #endif diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index df9500ea65c..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '{build}' -skip_branch_with_pr: true -shallow_clone: true -branches: - except: - - ___TGS3TempBranch - - ___TGSTempBranch -cache: - - C:\byond\ -> dependencies.sh, Dockerfile -build_script: - - ps: tools/appveyor/build.ps1 - - ps: "$deployPath = $env:APPVEYOR_BUILD_FOLDER + '/deploy'; bash tools/deploy.sh $deployPath" - - ps: "[System.IO.Compression.ZipFile]::CreateFromDirectory($env:APPVEYOR_BUILD_FOLDER + '/deploy', $env:APPVEYOR_BUILD_FOLDER + '/deploy.zip')" -artifacts: - - path: deploy.zip diff --git a/code/_compile_options.dm b/code/_compile_options.dm index c782c7605bf..d50022e7d5a 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -59,11 +59,11 @@ #warn compiling in TESTING mode. testing() debug messages will be visible. #endif -#ifdef TRAVISBUILDING +#ifdef CIBUILDING #define UNIT_TESTS #endif -#ifdef TRAVISTESTING +#ifdef CITESTING #define TESTING #endif diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 6561cc311b4..33233cb1721 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -689,7 +689,7 @@ /datum/design/surgery/healing //PLEASE ACCOUNT FOR UNIQUE HEALING BRANCHES IN THE hptech HREF (currently 2 for Brute/Burn; Combo is bonus) name = "Tend Wounds" desc = "An upgraded version of the original surgery." - id = "surgery_healing_base" //holder because travis cries otherwise. Not used in techweb unlocks. + id = "surgery_healing_base" //holder because CI cries otherwise. Not used in techweb unlocks. research_icon_state = "surgery_chest" /datum/design/surgery/healing/brute_upgrade diff --git a/tools/appveyor/build.ps1 b/tools/ci/build.ps1 similarity index 66% rename from tools/appveyor/build.ps1 rename to tools/ci/build.ps1 index 6bda0799771..8c9906dfe5c 100644 --- a/tools/appveyor/build.ps1 +++ b/tools/ci/build.ps1 @@ -1,10 +1,8 @@ if(!(Test-Path -Path "C:/byond")){ - bash tools/appveyor/download_byond.sh + bash tools/ci/download_byond.sh [System.IO.Compression.ZipFile]::ExtractToDirectory("C:/byond.zip", "C:/") Remove-Item C:/byond.zip } -Set-Location $env:APPVEYOR_BUILD_FOLDER - &"C:/byond/bin/dm.exe" -max_errors 0 tgstation.dme -exit $LASTEXITCODE \ No newline at end of file +exit $LASTEXITCODE diff --git a/tools/travis/build_spaceman_dmm.sh b/tools/ci/build_spaceman_dmm.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/build_spaceman_dmm.sh rename to tools/ci/build_spaceman_dmm.sh diff --git a/tools/travis/build_tgui.sh b/tools/ci/build_tgui.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/build_tgui.sh rename to tools/ci/build_tgui.sh diff --git a/tools/travis/check_changelogs.sh b/tools/ci/check_changelogs.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/check_changelogs.sh rename to tools/ci/check_changelogs.sh diff --git a/tools/travis/check_filedirs.sh b/tools/ci/check_filedirs.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/check_filedirs.sh rename to tools/ci/check_filedirs.sh diff --git a/tools/travis/check_grep.sh b/tools/ci/check_grep.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/check_grep.sh rename to tools/ci/check_grep.sh diff --git a/tools/travis/travis_config.txt b/tools/ci/ci_config.txt similarity index 82% rename from tools/travis/travis_config.txt rename to tools/ci/ci_config.txt index ff6bf9a793e..4925d781bbb 100644 --- a/tools/travis/travis_config.txt +++ b/tools/ci/ci_config.txt @@ -1,7 +1,7 @@ SQL_ENABLED ADDRESS 127.0.0.1 PORT 3306 -FEEDBACK_DATABASE tg_travis +FEEDBACK_DATABASE tg_ci FEEDBACK_TABLEPREFIX FEEDBACK_LOGIN root FEEDBACK_PASSWORD diff --git a/tools/travis/dm.sh b/tools/ci/dm.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/dm.sh rename to tools/ci/dm.sh diff --git a/tools/appveyor/download_byond.sh b/tools/ci/download_byond.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/appveyor/download_byond.sh rename to tools/ci/download_byond.sh diff --git a/tools/travis/install_build_tools.sh b/tools/ci/install_build_tools.sh old mode 100755 new mode 100644 similarity index 88% rename from tools/travis/install_build_tools.sh rename to tools/ci/install_build_tools.sh index c36cd571ba7..6c3e267fca3 --- a/tools/travis/install_build_tools.sh +++ b/tools/ci/install_build_tools.sh @@ -10,5 +10,3 @@ npm install --global yarn pip3 install --user PyYaml pip3 install --user beautifulsoup4 - -phpenv global $PHP_VERSION diff --git a/tools/travis/install_byond.sh b/tools/ci/install_byond.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/install_byond.sh rename to tools/ci/install_byond.sh diff --git a/tools/travis/install_rust_g.sh b/tools/ci/install_rust_g.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/install_rust_g.sh rename to tools/ci/install_rust_g.sh diff --git a/tools/travis/install_spaceman_dmm.sh b/tools/ci/install_spaceman_dmm.sh old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/install_spaceman_dmm.sh rename to tools/ci/install_spaceman_dmm.sh diff --git a/tools/ci/run_server.sh b/tools/ci/run_server.sh new file mode 100644 index 00000000000..f54c541bf66 --- /dev/null +++ b/tools/ci/run_server.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail + +tools/deploy.sh ci_test +rm ci_test/*.dll +mkdir ci_test/config + +#test config +cp tools/ci/ci_config.txt ci_test/config/config.txt + +cd ci_test +DreamDaemon tgstation.dmb -close -trusted -verbose -params "log-directory=ci" +cd .. +cat ci_test/data/logs/ci/clean_run.lk diff --git a/tools/travis/template_dm_generator.py b/tools/ci/template_dm_generator.py old mode 100755 new mode 100644 similarity index 100% rename from tools/travis/template_dm_generator.py rename to tools/ci/template_dm_generator.py diff --git a/tools/travis/run_server.sh b/tools/travis/run_server.sh deleted file mode 100755 index baa5e5ff770..00000000000 --- a/tools/travis/run_server.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -euo pipefail - -tools/deploy.sh travis_test -rm travis_test/*.dll -mkdir travis_test/config - -#test config -cp tools/travis/travis_config.txt travis_test/config/config.txt - -cd travis_test -DreamDaemon tgstation.dmb -close -trusted -verbose -params "log-directory=travis" -cd .. -cat travis_test/data/logs/travis/clean_run.lk