details-check.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # This action will check that LinuxGSM is picking up game server config and parameter variables.
  2. name: Details Check
  3. on:
  4. workflow_dispatch:
  5. push:
  6. branches:
  7. - develop
  8. permissions:
  9. contents: read
  10. concurrency:
  11. group: details-check-${{ github.ref_name }}
  12. cancel-in-progress: true
  13. jobs:
  14. create-matrix:
  15. if: github.repository_owner == 'GameServerManagers'
  16. runs-on: ubuntu-latest
  17. env:
  18. LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
  19. outputs:
  20. matrix: ${{ steps.set-matrix.outputs.matrix }}
  21. steps:
  22. - name: Checkout
  23. uses: actions/checkout@v6
  24. - name: Generate matrix with generate-matrix.sh
  25. run: chmod +x .github/workflows/details-check-generate-matrix.sh; .github/workflows/details-check-generate-matrix.sh
  26. - name: Set Matrix
  27. id: set-matrix
  28. run: |
  29. shortnamearray=$(cat shortnamearray.json)
  30. echo "${shortnamearray}"
  31. echo -n "matrix=${shortnamearray}" >> "$GITHUB_OUTPUT"
  32. details-check:
  33. if: github.repository_owner == 'GameServerManagers'
  34. needs: create-matrix
  35. continue-on-error: true
  36. runs-on: ${{ matrix.runner }}
  37. env:
  38. LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
  39. strategy:
  40. matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
  41. steps:
  42. - name: Download linuxgsm.sh
  43. run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh
  44. - name: Install dependencies
  45. run: sudo apt-get install libxml2-utils jq
  46. - name: Create serverfiles directory
  47. run: mkdir -p serverfiles
  48. - name: Grab server
  49. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server
  50. - name: Enable developer mode
  51. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer
  52. - name: Generate servercfgname
  53. id: sets-servercfgname
  54. run: |
  55. servercfg=$(sed -n "/^\<servercfgdefault\>/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg)
  56. echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT"
  57. - name: Download config
  58. run: |
  59. if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
  60. echo "This game server has no config file."
  61. else
  62. curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}"
  63. fi
  64. - name: Pre-load LinuxGSM
  65. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
  66. - name: Display config
  67. run: |
  68. if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
  69. echo "This game server has no config file."
  70. else
  71. cat config
  72. fi
  73. - name: Display parameters
  74. run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
  75. - name: Details
  76. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
  77. - name: Detect details
  78. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server parse-game-details
  79. - name: Query Raw
  80. run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server query-raw