Skip to content

Commit 03365ca

Browse files
authored
feat: serverlist validate (#4207)
* server list validate * dir * dir * dir * cr * add missing pc2 * pc2 * fix branch * exit code * repo * branch * fix csv * letter * tidy * codacy * exit code
1 parent f9a5ed0 commit 03365ca

25 files changed

+64
-19
lines changed

.github/workflows/details-check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
run: sudo apt-get install libxml2-utils jq
3636

3737
- name: Download linuxgsm.sh
38-
run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/feature/info_game-refactor/linuxgsm.sh; chmod +x linuxgsm.sh
38+
run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh
3939

4040
- name: Grab server
41-
run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./linuxgsm.sh ${{ matrix.shortname }}server
41+
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
4242

4343
- name: Enable developer mode
44-
run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server developer
44+
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
4545

4646
- id: sets-servercfgname
4747
name: Generate servercfgname
@@ -68,7 +68,7 @@ jobs:
6868
run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
6969

7070
- name: Detect details
71-
run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server detect-details
71+
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details
7272

7373
- name: Query Raw
74-
run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server query-raw
74+
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
echo "Checking that all the game servers are listed in all csv files"
3+
echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files"
4+
# count the number of lines in the serverlist.csv
5+
cd "lgsm/data" || exit
6+
serverlistcount="$(wc -l < serverlist.csv)"
7+
echo "serverlistcount: $serverlistcount"
8+
# get list of all csv files starting with ubunutu debian centos
9+
csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')"
10+
# loop though each csv file and make sure the number of lines is the same as the serverlistcount
11+
for csv in $csvlist; do
12+
csvcount="$(wc -l < "${csv}")"
13+
csvcount=$((csvcount-2))
14+
if [ "$csvcount" -ne "$serverlistcount" ]; then
15+
echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)"
16+
exitcode=1
17+
else
18+
echo "OK: $csv ($csvcount) and serverlist.csv ($serverlistcount) match"
19+
fi
20+
done
21+
22+
exit ${exitcode}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Server list Validation
2+
on:
3+
workflow_dispatch:
4+
push:
5+
6+
jobs:
7+
serverlist-validate:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: compare versions
13+
run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh

.github/workflows/version-check.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Version Check
42

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
73
on: push
84

9-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
105
permissions:
116
contents: read
127

138
jobs:
14-
# This workflow contains a single job called "build"
15-
Version-Check:
16-
# The type of runner that the job will run on
9+
version-Check:
1710
runs-on: ubuntu-latest
18-
19-
# Steps represent a sequence of tasks that will be executed as part of the job
2011
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2212
- uses: actions/checkout@v3
2313

24-
# Runs a single command using the runners shell
2514
- name: compare versions
2615
run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh

lgsm/data/almalinux-8.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686
7878
onset,mariadb-connector-c
7979
opfor
8080
pc
81+
pc2
8182
pmc,java-17-openjdk
8283
pstbs,GConf2
8384
pvkii

lgsm/data/almalinux-9.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686
7878
onset,mariadb-connector-c
7979
opfor
8080
pc
81+
pc2
8182
pmc,java-17-openjdk
8283
pstbs,GConf2
8384
pvkii

lgsm/data/centos-7.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686
7878
onset,mariadb-connector-c
7979
opfor
8080
pc
81+
pc2
8182
pmc,java-11-openjdk
8283
pstbs,GConf2
8384
pvkii

lgsm/data/centos-8.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686
7878
onset,mariadb-connector-c
7979
opfor
8080
pc
81+
pc2
8182
pmc,java-17-openjdk
8283
pstbs,GConf2
8384
pvkii

lgsm/data/centos-9.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686
7878
onset,mariadb-connector-c
7979
opfor
8080
pc
81+
pc2
8182
pmc,java-17-openjdk
8283
pstbs,GConf2
8384
pvkii

lgsm/data/debian-10.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2
7878
onset,libmariadb-dev
7979
opfor
8080
pc
81+
pc2
8182
pmc,openjdk-11-jre
8283
pstbs,libgconf-2-4
8384
pvkii

0 commit comments

Comments
 (0)