|
@@ -16,18 +16,21 @@ concurrency:
|
|
|
group: details-check-${{ github.ref_name }}
|
|
group: details-check-${{ github.ref_name }}
|
|
|
cancel-in-progress: true
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
+env:
|
|
|
|
|
+ LGSM_REF: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
|
+
|
|
|
jobs:
|
|
jobs:
|
|
|
create-matrix:
|
|
create-matrix:
|
|
|
if: github.repository_owner == 'GameServerManagers'
|
|
if: github.repository_owner == 'GameServerManagers'
|
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
- env:
|
|
|
|
|
- LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
|
|
|
|
|
outputs:
|
|
outputs:
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
|
+ legacy: ${{ steps.set-matrix.outputs.legacy }}
|
|
|
steps:
|
|
steps:
|
|
|
- name: Checkout
|
|
- name: Checkout
|
|
|
uses: actions/checkout@v7
|
|
uses: actions/checkout@v7
|
|
|
with:
|
|
with:
|
|
|
|
|
+ ref: ${{ env.LGSM_REF }}
|
|
|
# Full history so the base branch ref is available for the
|
|
# Full history so the base branch ref is available for the
|
|
|
# `git diff origin/<base>...HEAD` comparison below (a shallow
|
|
# `git diff origin/<base>...HEAD` comparison below (a shallow
|
|
|
# checkout has no origin/<base> and the diff fails).
|
|
# checkout has no origin/<base> and the diff fails).
|
|
@@ -44,7 +47,7 @@ jobs:
|
|
|
# Only these modules directly affect what 'details', 'parse-game-details'
|
|
# Only these modules directly affect what 'details', 'parse-game-details'
|
|
|
# and 'query-raw' output. Everything else (install, fix, update, check_*,
|
|
# and 'query-raw' output. Everything else (install, fix, update, check_*,
|
|
|
# data CSVs, game icons, etc.) is irrelevant to this check.
|
|
# data CSVs, game icons, etc.) is irrelevant to this check.
|
|
|
- details_core='^(linuxgsm\.sh|lgsm/modules/(info_game|info_messages|command_details|command_dev_parse_game_details|command_dev_query_raw|core_modules)\.sh)$'
|
|
|
|
|
|
|
+ details_core='^(linuxgsm\.sh|lgsm/modules/(info_game|info_messages|command_details|command_dev_parse_game_details|command_dev_query_raw|core_modules)\.sh|\.github/workflows/action-details-check\.yml|\.github/scripts/details-check-.*\.sh)$'
|
|
|
if echo "$changed" | grep -qE "${details_core}"; then
|
|
if echo "$changed" | grep -qE "${details_core}"; then
|
|
|
echo "Details-relevant core file changed — using full matrix."
|
|
echo "Details-relevant core file changed — using full matrix."
|
|
|
echo "mode=full" >> "$GITHUB_OUTPUT"
|
|
echo "mode=full" >> "$GITHUB_OUTPUT"
|
|
@@ -64,7 +67,7 @@ jobs:
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- - name: Generate matrix with generate-matrix.sh
|
|
|
|
|
|
|
+ - name: Generate matrix
|
|
|
if: github.event_name != 'pull_request' || steps.targeted.outputs.mode != 'skip'
|
|
if: github.event_name != 'pull_request' || steps.targeted.outputs.mode != 'skip'
|
|
|
run: |
|
|
run: |
|
|
|
if [ -f targeted_shortnames.txt ]; then
|
|
if [ -f targeted_shortnames.txt ]; then
|
|
@@ -76,29 +79,30 @@ jobs:
|
|
|
- name: Set Matrix
|
|
- name: Set Matrix
|
|
|
id: set-matrix
|
|
id: set-matrix
|
|
|
run: |
|
|
run: |
|
|
|
- if [ ! -f shortnamearray.json ]; then
|
|
|
|
|
|
|
+ if [ ! -f shards.json ]; then
|
|
|
echo 'matrix={"include":[]}' >> "$GITHUB_OUTPUT"
|
|
echo 'matrix={"include":[]}' >> "$GITHUB_OUTPUT"
|
|
|
|
|
+ echo 'legacy=' >> "$GITHUB_OUTPUT"
|
|
|
else
|
|
else
|
|
|
- shortnamearray=$(cat shortnamearray.json)
|
|
|
|
|
- echo "${shortnamearray}"
|
|
|
|
|
- echo -n "matrix=${shortnamearray}" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
+ cat shards.json
|
|
|
|
|
+ echo "matrix=$(cat shards.json)" >> "$GITHUB_OUTPUT"
|
|
|
|
|
+ echo "legacy=$(cat legacy.txt)" >> "$GITHUB_OUTPUT"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
details-check:
|
|
details-check:
|
|
|
|
|
+ name: details-check (${{ matrix.shard }})
|
|
|
# Skip (rather than fail the run) when create-matrix found nothing to check.
|
|
# Skip (rather than fail the run) when create-matrix found nothing to check.
|
|
|
if: github.repository_owner == 'GameServerManagers' && needs.create-matrix.outputs.matrix != '{"include":[]}'
|
|
if: github.repository_owner == 'GameServerManagers' && needs.create-matrix.outputs.matrix != '{"include":[]}'
|
|
|
needs: create-matrix
|
|
needs: create-matrix
|
|
|
continue-on-error: true
|
|
continue-on-error: true
|
|
|
- runs-on: ${{ matrix.runner }}
|
|
|
|
|
- env:
|
|
|
|
|
- LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
|
|
|
|
|
-
|
|
|
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
strategy:
|
|
strategy:
|
|
|
|
|
+ fail-fast: false
|
|
|
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
|
|
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
|
|
|
-
|
|
|
|
|
steps:
|
|
steps:
|
|
|
- - name: Download linuxgsm.sh
|
|
|
|
|
- run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh
|
|
|
|
|
|
|
+ - name: Checkout
|
|
|
|
|
+ uses: actions/checkout@v7
|
|
|
|
|
+ with:
|
|
|
|
|
+ ref: ${{ env.LGSM_REF }}
|
|
|
|
|
|
|
|
- name: Cache apt packages
|
|
- name: Cache apt packages
|
|
|
uses: actions/cache@v6
|
|
uses: actions/cache@v6
|
|
@@ -109,74 +113,36 @@ jobs:
|
|
|
- name: Install dependencies
|
|
- name: Install dependencies
|
|
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libxml2-utils jq
|
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libxml2-utils jq
|
|
|
|
|
|
|
|
- - name: Create serverfiles directory
|
|
|
|
|
- run: mkdir -p serverfiles
|
|
|
|
|
-
|
|
|
|
|
- - name: Grab server
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server
|
|
|
|
|
-
|
|
|
|
|
- - name: Enable developer mode
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer
|
|
|
|
|
-
|
|
|
|
|
- - name: Generate servercfgname
|
|
|
|
|
- id: sets-servercfgname
|
|
|
|
|
- run: |
|
|
|
|
|
- servercfg=$(sed -n "/^\<servercfgdefault\>/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg)
|
|
|
|
|
- echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT"
|
|
|
|
|
-
|
|
|
|
|
- - name: Download config
|
|
|
|
|
- run: |
|
|
|
|
|
- if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
|
|
|
|
|
- echo "This game server has no config file."
|
|
|
|
|
- else
|
|
|
|
|
- curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}"
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ - name: Details check
|
|
|
|
|
+ run: .github/scripts/details-check-run.sh ${{ matrix.shortnames }}
|
|
|
|
|
|
|
|
- - name: Pre-load LinuxGSM
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
|
|
|
|
|
-
|
|
|
|
|
- - name: Display config
|
|
|
|
|
|
|
+ details-check-legacy:
|
|
|
|
|
+ name: details-check (legacy)
|
|
|
|
|
+ if: github.repository_owner == 'GameServerManagers' && needs.create-matrix.outputs.legacy != ''
|
|
|
|
|
+ needs: create-matrix
|
|
|
|
|
+ continue-on-error: true
|
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
|
|
+ container: public.ecr.aws/ubuntu/ubuntu:20.04
|
|
|
|
|
+ steps:
|
|
|
|
|
+ - name: Install dependencies
|
|
|
|
|
+ env:
|
|
|
|
|
+ DEBIAN_FRONTEND: noninteractive
|
|
|
run: |
|
|
run: |
|
|
|
- if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
|
|
|
|
|
- echo "This game server has no config file."
|
|
|
|
|
- else
|
|
|
|
|
- cat config
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- - name: Display parameters
|
|
|
|
|
- run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
|
|
|
|
|
-
|
|
|
|
|
- - name: Details
|
|
|
|
|
- id: details
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
|
|
|
|
|
-
|
|
|
|
|
- - name: Detect details
|
|
|
|
|
- id: detect-details
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server parse-game-details
|
|
|
|
|
|
|
+ apt-get update
|
|
|
|
|
+ apt-get install -y --no-install-recommends ca-certificates curl wget git sudo iproute2 libxml2-utils jq \
|
|
|
|
|
+ bc binutils bsdmainutils bzip2 cpio distro-info file gzip hostname lib32gcc-s1 lib32stdc++6 \
|
|
|
|
|
+ netcat-openbsd pigz python3 tar tmux unzip util-linux uuid-runtime xz-utils
|
|
|
|
|
|
|
|
- - name: Query Raw
|
|
|
|
|
- id: query-raw
|
|
|
|
|
- run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server query-raw
|
|
|
|
|
|
|
+ - name: Checkout
|
|
|
|
|
+ uses: actions/checkout@v7
|
|
|
|
|
+ with:
|
|
|
|
|
+ ref: ${{ env.LGSM_REF }}
|
|
|
|
|
|
|
|
- - name: Write job summary
|
|
|
|
|
- if: always()
|
|
|
|
|
|
|
+ - name: Details check
|
|
|
run: |
|
|
run: |
|
|
|
- status_icon() {
|
|
|
|
|
- case "$1" in
|
|
|
|
|
- success) echo "✅" ;;
|
|
|
|
|
- failure) echo "❌" ;;
|
|
|
|
|
- skipped) echo "⏭️" ;;
|
|
|
|
|
- *) echo "⚠️" ;;
|
|
|
|
|
- esac
|
|
|
|
|
- }
|
|
|
|
|
- details_icon=$(status_icon "${{ steps.details.outcome }}")
|
|
|
|
|
- parse_icon=$(status_icon "${{ steps.detect-details.outcome }}")
|
|
|
|
|
- query_icon=$(status_icon "${{ steps.query-raw.outcome }}")
|
|
|
|
|
- {
|
|
|
|
|
- echo "## ${{ matrix.shortname }}server"
|
|
|
|
|
- echo "| Step | Result |"
|
|
|
|
|
- echo "|------|--------|"
|
|
|
|
|
- echo "| Details | ${details_icon} ${{ steps.details.outcome }} |"
|
|
|
|
|
- echo "| Parse game details | ${parse_icon} ${{ steps.detect-details.outcome }} |"
|
|
|
|
|
- echo "| Query raw | ${query_icon} ${{ steps.query-raw.outcome }} |"
|
|
|
|
|
- } >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
|
|
|
+ useradd -m linuxgsm
|
|
|
|
|
+ echo "linuxgsm ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/linuxgsm
|
|
|
|
|
+ chown -R linuxgsm:linuxgsm "${GITHUB_WORKSPACE}"
|
|
|
|
|
+ chmod a+w "${GITHUB_STEP_SUMMARY}"
|
|
|
|
|
+ sudo -u linuxgsm -H env LGSM_REF="${LGSM_REF}" GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY}" \
|
|
|
|
|
+ "${GITHUB_WORKSPACE}/.github/scripts/details-check-run.sh" ${{ needs.create-matrix.outputs.legacy }}
|