Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39273908ac | |||
|
|
7be3c928b7 | ||
|
|
f8c14cc268 | ||
|
|
566d72c2d6 | ||
| ad26d22281 | |||
| 352b4e57d7 |
2
.github/workflows/engine_test.yml
vendored
2
.github/workflows/engine_test.yml
vendored
@@ -9,8 +9,6 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run Engine tests
|
||||
run: |
|
||||
bash .github/workflows/test.sh engine/
|
||||
|
||||
2
.github/workflows/server_test.yml
vendored
2
.github/workflows/server_test.yml
vendored
@@ -9,8 +9,6 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run Server tests
|
||||
run: |
|
||||
bash .github/workflows/test.sh server/
|
||||
|
||||
2
.github/workflows/test.sh
vendored
2
.github/workflows/test.sh
vendored
@@ -38,3 +38,5 @@ cat "$LOG_FILE" >> "$FINAL_LOG"
|
||||
# --- SUMMARY ---
|
||||
echo ">>> Test output extracted to $PROJECT_PATH/$LOG_FILE"
|
||||
echo ">>> Appended to $FINAL_LOG"
|
||||
|
||||
cat $(git rev-parse --show-toplevel)/test_data.log
|
||||
|
||||
2
.github/workflows/ui_test.yml
vendored
2
.github/workflows/ui_test.yml
vendored
@@ -9,8 +9,6 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run UI tests
|
||||
run: |
|
||||
bash .github/workflows/test.sh ui/
|
||||
|
||||
70
.github/workflows/upload_data.yml
vendored
70
.github/workflows/upload_data.yml
vendored
@@ -20,33 +20,77 @@ jobs:
|
||||
echo "$GOOGLE_SERVICE_ACCOUNT_JSON" > service_account.json
|
||||
|
||||
python <<'PYCODE'
|
||||
import gspread, json, time, subprocess
|
||||
import gspread, json, subprocess
|
||||
|
||||
# credentials
|
||||
creds = json.load(open("service_account.json"))
|
||||
gc = gspread.service_account_from_dict(creds)
|
||||
sh = gc.open_by_key("${{ secrets.SPREADSHEET_ID }}")
|
||||
v = subprocess.run(['git','rev-parse','--show-toplevel'], capture_output=True).stdout.decode().strip()
|
||||
print(f"{v}/test_data.log")
|
||||
|
||||
|
||||
def writeRowsToSpreadsheet(data_list, worksheet):
|
||||
existing_rows = len(worksheet.get_all_values())
|
||||
start_row = existing_rows + 3
|
||||
rows_to_append = [row.split() for row in data_list]
|
||||
print("rows to append")
|
||||
print(f"{rows_to_append}")
|
||||
|
||||
for i, row in enumerate(rows_to_append):
|
||||
worksheet.insert_row(row, start_row + i)
|
||||
|
||||
|
||||
with open(f"{v}/test_data.log", "r") as f:
|
||||
lines = [line.strip() for line in f if line.strip()]
|
||||
|
||||
isMaster = False
|
||||
project = lines[0].lower()
|
||||
worksheet = sh.worksheet(project)
|
||||
if project == "master":
|
||||
isMaster = True
|
||||
|
||||
engine_data = []
|
||||
server_data = []
|
||||
ui_data = []
|
||||
master_data = []
|
||||
|
||||
# project name
|
||||
data = lines[1:]
|
||||
for entry in lines:
|
||||
if not isMaster and entry == "engine":
|
||||
project = "engine"
|
||||
elif not isMaster and entry == "server":
|
||||
project = "server"
|
||||
elif not isMaster and entry == "ui":
|
||||
project = "ui"
|
||||
|
||||
#blank rows
|
||||
existing_rows = len(worksheet.get_all_values())
|
||||
start_row = existing_rows + 3
|
||||
if project == "engine" and entry != "engine":
|
||||
engine_data.append(entry)
|
||||
elif project == "server" and entry != "server":
|
||||
server_data.append(entry)
|
||||
elif project == "ui" and entry != "ui":
|
||||
ui_data.append(entry)
|
||||
elif project == "master" and entry != "master":
|
||||
master_data.append(entry)
|
||||
|
||||
# Split data into columns (by spaces)
|
||||
rows_to_append = [row.split() for row in data]
|
||||
print("PRINTING FILTERED DATA\n\n")
|
||||
print(f"engine\n{engine_data}")
|
||||
print(f"server\n{server_data}")
|
||||
print(f"ui\n{ui_data}")
|
||||
print(f"master\n{master_data}")
|
||||
print("\n\n\n")
|
||||
|
||||
for i, row in enumerate(rows_to_append):
|
||||
worksheet.insert_row(row, start_row + i)
|
||||
if isMaster and len(master_data) != 0:
|
||||
print("uploading to master tab")
|
||||
worksheet = sh.worksheet("master")
|
||||
writeRowsToSpreadsheet(master_data, worksheet)
|
||||
exit(0)
|
||||
|
||||
if len(engine_data) != 0:
|
||||
print("uploading to engine tab")
|
||||
writeRowsToSpreadsheet(engine_data, sh.worksheet("engine"))
|
||||
if len(server_data) != 0:
|
||||
print("uploading to server tab")
|
||||
writeRowsToSpreadsheet(server_data, sh.worksheet("server"))
|
||||
if len(ui_data) != 0:
|
||||
print("uploading to ui tab")
|
||||
writeRowsToSpreadsheet(ui_data, sh.worksheet("ui"))
|
||||
|
||||
print(f"Uploaded {len(rows_to_append)} rows to '{project}' tab.")
|
||||
PYCODE
|
||||
|
||||
Reference in New Issue
Block a user