Compare commits
17 Commits
Docs/funk_
...
v17
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b4194ee7d | |||
|
|
4763cbed95 | ||
|
|
9253283953 | ||
| 596828e827 | |||
|
|
c6c2e27d34 | ||
| bc2eca7eac | |||
| 86ceab10ad | |||
| 785e40f538 | |||
| 39da1be9de | |||
|
|
7ef9855016 | ||
|
|
b5902c0bb7 | ||
| 76a1c18b56 | |||
|
|
27394df920 | ||
| 3df33093ed | |||
| 300b3cde34 | |||
| a19e0bf922 | |||
| 7625eecbd9 |
98
.github/workflows/dispatcher.yml
vendored
Normal file
98
.github/workflows/dispatcher.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
name: Dispatcher
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch:
|
||||||
|
runs-on: self-hosted
|
||||||
|
outputs:
|
||||||
|
engine: ${{ steps.check.outputs.engine }}
|
||||||
|
server: ${{ steps.check.outputs.server }}
|
||||||
|
ui: ${{ steps.check.outputs.ui }}
|
||||||
|
steps:
|
||||||
|
- name: Determine which tests to run
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
BRANCH="${{ github.ref_name }}"
|
||||||
|
echo "Branch: $BRANCH"
|
||||||
|
|
||||||
|
ENGINE=false
|
||||||
|
SERVER=false
|
||||||
|
UI=false
|
||||||
|
|
||||||
|
if [[ "$BRANCH" == *"Engine"* ]]; then
|
||||||
|
ENGINE=true
|
||||||
|
fi
|
||||||
|
if [[ "$BRANCH" == *"Server"* ]]; then
|
||||||
|
SERVER=true
|
||||||
|
fi
|
||||||
|
if [[ "$BRANCH" == *"UI"* ]]; then
|
||||||
|
UI=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run all on master
|
||||||
|
if [[ "$BRANCH" == "master" ]]; then
|
||||||
|
ENGINE=true
|
||||||
|
SERVER=true
|
||||||
|
UI=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "engine=$ENGINE" >> $GITHUB_OUTPUT
|
||||||
|
echo "server=$SERVER" >> $GITHUB_OUTPUT
|
||||||
|
echo "ui=$UI" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
engine:
|
||||||
|
needs: dispatch
|
||||||
|
if: needs.dispatch.outputs.engine == 'true'
|
||||||
|
uses: ./.github/workflows/engine_test.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
server:
|
||||||
|
needs: dispatch
|
||||||
|
if: needs.dispatch.outputs.server == 'true'
|
||||||
|
uses: ./.github/workflows/server_test.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
ui:
|
||||||
|
needs: dispatch
|
||||||
|
if: needs.dispatch.outputs.ui == 'true'
|
||||||
|
uses: ./.github/workflows/ui_test.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
|
||||||
|
test-data-upload:
|
||||||
|
needs: [engine, server, ui]
|
||||||
|
runs-on: self-hosted
|
||||||
|
if: always()
|
||||||
|
#uses: ./.github/workflows/upload_data.yml
|
||||||
|
steps:
|
||||||
|
- name: Temp turn off
|
||||||
|
run: |
|
||||||
|
echo "Uploading data to table"
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: test-data-upload
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: ./.github/workflows/release.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
runs-on: self-hosted
|
||||||
|
needs: [engine, server, ui, test-data-upload, release]
|
||||||
|
if: always()
|
||||||
|
steps:
|
||||||
|
- name: Final cleanup
|
||||||
|
run: |
|
||||||
|
echo "Final cleanup on self-hosted runner..."
|
||||||
|
cd "$GITHUB_WORKSPACE"
|
||||||
|
git clean -fdx
|
||||||
|
git reset --hard
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
17
.github/workflows/engine_test.yml
vendored
Normal file
17
.github/workflows/engine_test.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Engine Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
engine-tests:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Engine tests
|
||||||
|
run: |
|
||||||
|
bash .github/workflows/test.sh engine/
|
||||||
97
.github/workflows/release.yml
vendored
Normal file
97
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
name: Release build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Build and release (master only)
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build Engine for Linux
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/linux -p
|
||||||
|
cd engine/
|
||||||
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
|
cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-unknown-linux-gnu/release/engine $(git rev-parse --show-toplevel)/release/linux/engine
|
||||||
|
|
||||||
|
- name: Build Server for Linux
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/linux -p
|
||||||
|
cd server/
|
||||||
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
|
cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-unknown-linux-gnu/release/server $(git rev-parse --show-toplevel)/release/linux/server
|
||||||
|
|
||||||
|
- name: Build UI for Linux
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/linux -p
|
||||||
|
cd ui/
|
||||||
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
|
cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-unknown-linux-gnu/release/ui $(git rev-parse --show-toplevel)/release/linux/ui
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build Engine for Windows
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/windows -p
|
||||||
|
cd engine/
|
||||||
|
rustup target add x86_64-pc-windows-gnu
|
||||||
|
cargo build --release --target x86_64-pc-windows-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-pc-windows-gnu/release/engine.exe $(git rev-parse --show-toplevel)/release/windows/engine.exe
|
||||||
|
|
||||||
|
- name: Build Server for Windows
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/windows -p
|
||||||
|
cd server/
|
||||||
|
rustup target add x86_64-pc-windows-gnu
|
||||||
|
cargo build --release --target x86_64-pc-windows-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-pc-windows-gnu/release/server.exe $(git rev-parse --show-toplevel)/release/windows/server.exe
|
||||||
|
|
||||||
|
- name: Build UI for Windows
|
||||||
|
run: |
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
pwd
|
||||||
|
mkdir release/windows -p
|
||||||
|
cd ui/
|
||||||
|
rustup target add x86_64-pc-windows-gnu
|
||||||
|
cargo build --release --target x86_64-pc-windows-gnu
|
||||||
|
pwd
|
||||||
|
cp target/x86_64-pc-windows-gnu/release/ui.exe $(git rev-parse --show-toplevel)/release/windows/ui.exe
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: "v${{ github.run_number }}"
|
||||||
|
name: "Release v${{ github.run_number }}"
|
||||||
|
files: |
|
||||||
|
release/*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
17
.github/workflows/server_test.yml
vendored
Normal file
17
.github/workflows/server_test.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Server Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
server-tests:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Server tests
|
||||||
|
run: |
|
||||||
|
bash .github/workflows/test.sh server/
|
||||||
37
.github/workflows/test.sh
vendored
Executable file
37
.github/workflows/test.sh
vendored
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# --- ARGUMENT CHECK ---
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Usage: $0 <project_path>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- SETUP VARIABLES ---
|
||||||
|
PROJECT_PATH="$1"
|
||||||
|
PROJECT_NAME=$(basename "$PROJECT_PATH")
|
||||||
|
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
LOG_FILE="${PROJECT_NAME}_test.log"
|
||||||
|
FINAL_LOG="${ROOT_DIR}/test_data.log"
|
||||||
|
|
||||||
|
# --- MOVE TO PROJECT DIRECTORY ---
|
||||||
|
echo ">>> Running tests for project: $PROJECT_NAME"
|
||||||
|
cd "$PROJECT_PATH" || { echo "Error: Could not cd into $PROJECT_PATH"; exit 1; }
|
||||||
|
|
||||||
|
# --- RUN TESTS ---
|
||||||
|
cargo test --verbose | tee full_test_output.log
|
||||||
|
|
||||||
|
# --- EXTRACT TEST SECTION ---
|
||||||
|
# Create the log file with the project name as the first line
|
||||||
|
echo "$PROJECT_NAME" > "$LOG_FILE"
|
||||||
|
|
||||||
|
# Then append only the lines between "running X test(s)" and the first empty line
|
||||||
|
awk '/^running [0-9]+ test[s]?$/,/^$/' full_test_output.log >> "$LOG_FILE"
|
||||||
|
|
||||||
|
# --- APPEND TO GLOBAL LOG (in repo root) ---
|
||||||
|
cat "$LOG_FILE" >> "$FINAL_LOG"
|
||||||
|
|
||||||
|
# --- SUMMARY ---
|
||||||
|
echo ">>> Test output extracted to $PROJECT_PATH/$LOG_FILE"
|
||||||
|
echo ">>> Appended to $FINAL_LOG"
|
||||||
17
.github/workflows/ui_test.yml
vendored
Normal file
17
.github/workflows/ui_test.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: UI Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ui-tests:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run UI tests
|
||||||
|
run: |
|
||||||
|
bash .github/workflows/test.sh ui/
|
||||||
57
.github/workflows/upload_data.yml
vendored
Normal file
57
.github/workflows/upload_data.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: Upload Test Results to Google Sheets
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python (for Google Sheets API)
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install gspread google-auth
|
||||||
|
|
||||||
|
- name: Upload test_data.log to Google Sheets
|
||||||
|
env:
|
||||||
|
GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
|
||||||
|
SPREADSHEET_ID: ${{ secrets.SPREADSHEET_ID }}
|
||||||
|
run: |
|
||||||
|
echo "$GOOGLE_SERVICE_ACCOUNT_JSON" > service_account.json
|
||||||
|
|
||||||
|
python <<'PYCODE'
|
||||||
|
import gspread, json, time
|
||||||
|
|
||||||
|
# credentials
|
||||||
|
creds = json.load(open("service_account.json"))
|
||||||
|
gc = gspread.service_account_from_dict(creds)
|
||||||
|
sh = gc.open_by_key("${{ secrets.SPREADSHEET_ID }}")
|
||||||
|
|
||||||
|
with open("test_data.log", "r") as f:
|
||||||
|
lines = [line.strip() for line in f if line.strip()]
|
||||||
|
|
||||||
|
project = lines[0].lower()
|
||||||
|
worksheet = sh.worksheet(project)
|
||||||
|
|
||||||
|
# project name
|
||||||
|
data = lines[1:]
|
||||||
|
|
||||||
|
#blank rows
|
||||||
|
existing_rows = len(worksheet.get_all_values())
|
||||||
|
start_row = existing_rows + 3
|
||||||
|
|
||||||
|
# Split data into columns (by spaces)
|
||||||
|
rows_to_append = [row.split() for row in data]
|
||||||
|
|
||||||
|
for i, row in enumerate(rows_to_append):
|
||||||
|
worksheet.insert_row(row, start_row + i)
|
||||||
|
|
||||||
|
print(f"Uploaded {len(rows_to_append)} rows to '{project}' tab.")
|
||||||
|
PYCODE
|
||||||
4
engine/.cargo/config.toml
Normal file
4
engine/.cargo/config.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "x86_64-linux-gnu-gcc"
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "x86_64-w64-mingw32-gcc"
|
||||||
4
server/.cargo/config.toml
Normal file
4
server/.cargo/config.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "x86_64-linux-gnu-gcc"
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "x86_64-w64-mingw32-gcc"
|
||||||
4
ui/.cargo/config.toml
Normal file
4
ui/.cargo/config.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "x86_64-linux-gnu-gcc"
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "x86_64-w64-mingw32-gcc"
|
||||||
Reference in New Issue
Block a user