build_servers_modes.yml 2.8 KB

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