npc_db_validation.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. name: Validate NPC Scripts and DB Changes
  2. # npc_db_validation.yml
  3. # For NPC and DB validation we only need two builds: one of Renewal and one for Pre-Renewal checks.
  4. # NPC scripts and database files are not platform dependent, so we can achieve this validation using only a simple linux setup.
  5. concurrency:
  6. group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
  7. cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
  8. on:
  9. workflow_dispatch:
  10. push:
  11. branches:
  12. - master
  13. pull_request:
  14. paths:
  15. # Always trigger all Github Actions if an action or something CI related was changed
  16. - '.github/workflows/**'
  17. - 'tools/ci/**'
  18. # This workflow should run when a file in either the db/ or npc/ directory has been modified.
  19. - 'db/**'
  20. - 'npc/**'
  21. jobs:
  22. build:
  23. # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version.
  24. # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot.
  25. if: "!contains(github.event.head_commit.message, 'ci-skip')"
  26. runs-on: ${{ matrix.os }}
  27. strategy:
  28. matrix:
  29. # The ubuntu-latest label currently points to ubuntu-24.04.
  30. # Available: ubuntu-24.04, ubuntu-22.04
  31. os: [ubuntu-latest]
  32. # Only a single version of GCC is required for validating NPC scripts and database changes.
  33. gcc: ['11']
  34. # We run build checks for both Renewal and PRE-Renewal
  35. mode: ['PRE', 'RE']
  36. steps:
  37. - uses: actions/checkout@v4
  38. # 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.
  39. - name: Variable Parsing - PRE
  40. if: ${{ matrix.mode == 'PRE' }}
  41. run: |
  42. echo "PRERE=yes" >> $GITHUB_ENV
  43. - name: Variable Parsing - RE
  44. if: ${{ matrix.mode == 'RE' }}
  45. run: |
  46. echo "PRERE=no" >> $GITHUB_ENV
  47. - name: Update & Install packages
  48. # Ubuntu runners already have most of the packages rAthena requires to build.
  49. # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
  50. run: |
  51. sudo apt update
  52. sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
  53. - name: Start MySQL
  54. run: sudo systemctl start mysql.service
  55. - name: Setup Database and import table data
  56. run: ./tools/ci/sql.sh
  57. - name: Command - configure
  58. env:
  59. CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes'
  60. run: ./configure $CONFIGURE_FLAGS
  61. # npc.sh enables all NPC scripts in the custom and test folders.
  62. - name: Enable All NPCs for Testing
  63. run: ./tools/ci/npc.sh
  64. - name: Command - make clean
  65. run: make clean
  66. # Create import directories
  67. - name: Command - make import
  68. run: make import
  69. - name: Command - make map
  70. run: make map
  71. - name: Run Once - map-server
  72. run: ./map-server --run-once