build_servers_modes.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: Build servers in Pre-Renewal and Renewal
  2. # build_servers_modes.yml
  3. concurrency:
  4. group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
  5. cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
  6. on:
  7. workflow_dispatch:
  8. push:
  9. branches:
  10. - master
  11. pull_request:
  12. paths:
  13. # Always trigger all Github Actions if an action or something CI related was changed
  14. - '.github/workflows/**'
  15. - 'tools/ci/**'
  16. # This workflow should run when a file in a source directory has been modified.
  17. - 'src/**'
  18. - '3rdparty/**'
  19. jobs:
  20. build:
  21. # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version.
  22. # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot.
  23. if: "!contains(github.event.head_commit.message, 'ci-skip')"
  24. runs-on: ${{ matrix.os }}
  25. strategy:
  26. matrix:
  27. # The ubuntu-latest label currently points to ubuntu-24.04.
  28. # Available: ubuntu-24.04, ubuntu-22.04
  29. os: [ubuntu-latest]
  30. # Older versions of GCC are not available via unaltered aptitude repo lists.
  31. gcc: ['11']
  32. # We run build checks for both Renewal and PRE-Renewal
  33. mode: ['PRE','RE']
  34. steps:
  35. - uses: actions/checkout@v4
  36. # A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler.
  37. - name: Variable Parsing - PRE
  38. if: ${{ matrix.mode == 'PRE' }}
  39. run: |
  40. echo "PRERE=yes" >> $GITHUB_ENV
  41. - name: Variable Parsing - RE
  42. if: ${{ matrix.mode == 'RE' }}
  43. run: |
  44. echo "PRERE=no" >> $GITHUB_ENV
  45. - name: Update & Install packages
  46. # Ubuntu runners already have most of the packages rAthena requires to build.
  47. # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
  48. run: |
  49. sudo apt update
  50. sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
  51. - name: Start MySQL
  52. run: sudo systemctl start mysql.service
  53. - name: Setup Database and import table data
  54. run: ./tools/ci/sql.sh
  55. - name: Command - configure
  56. env:
  57. CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes'
  58. run: ./configure $CONFIGURE_FLAGS
  59. - name: Command - make clean
  60. run: make clean
  61. - name: Command - make server
  62. run: make server
  63. - name: Run Once - login-server
  64. run: ./login-server --run-once
  65. - name: Run Once - char-server
  66. run: ./char-server --run-once
  67. - name: Run Once - map-server
  68. run: ./map-server --run-once