Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
path: GM-TF
- name: Testing Manually with passing RSS_Feed for Beta builds
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_BETA }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }}
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_BETA }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }} --gmpm-registry '${{ secrets.GMPM_REGISTRY }}' --gmpm-username '${{ secrets.GMPM_USERNAME }}' --gmpm-password '${{ secrets.GMPM_PASSWORD }}'
working-directory: GM-TF
shell: pwsh
- name: Upload Results Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
path: GM-TF
- name: Testing on PR
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\config_ci.json" --feed '${{ secrets.RSS_FEED_RED }}' ${{ github.event.inputs.EXTRA_PARAMS }}
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\config_ci.json" --feed '${{ secrets.RSS_FEED_RED }}' ${{ github.event.inputs.EXTRA_PARAMS }} --gmpm-registry '${{ secrets.GMPM_REGISTRY }}' --gmpm-username '${{ secrets.GMPM_USERNAME }}' --gmpm-password '${{ secrets.GMPM_PASSWORD }}'
working-directory: GM-TF
shell: pwsh
continue-on-error: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
path: GM-TF
- name: Testing Manually witth passing RSS_Feed for Monthly builds
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_GREEN }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }}
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_GREEN }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }} --gmpm-registry '${{ secrets.GMPM_REGISTRY }}' --gmpm-username '${{ secrets.GMPM_USERNAME }}' --gmpm-password '${{ secrets.GMPM_PASSWORD }}'
working-directory: GM-TF
shell: pwsh
- name: Upload Results Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Red.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
path: GM-TF
- name: Testing Manually with passing RSS_Feed for Red builds
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_RED }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }}
run: ./launcher igorRunTests --config-file "C:\GM-TestFramework\configs\${{ github.event.inputs.CONFIG_FILE }}" --feed '${{ secrets.RSS_FEED_RED }}' ${{ github.event.inputs.EXTRA_PARAMS }} -rv ${{ github.event.inputs.RUNTIME_VERSION }} --gmpm-registry '${{ secrets.GMPM_REGISTRY }}' --gmpm-username '${{ secrets.GMPM_USERNAME }}' --gmpm-password '${{ secrets.GMPM_PASSWORD }}'
working-directory: GM-TF
shell: pwsh
continue-on-error: false
Expand Down
106 changes: 105 additions & 1 deletion classes/commands/IgorRunTestsCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from functools import partial
from pathlib import Path
import re
import base64
import argparse
import subprocess
import json
import time
from typing import Any, Optional, Tuple
import requests
Expand All @@ -14,6 +16,8 @@
import os
import shutil
import platform
import sys
from urllib.parse import urlparse

from classes.commands.BaseCommand import DEFAULT_CONFIG, HTTP_PORT, TCP_PORT, BaseCommand
from classes.server.RemoteControlServer import (RemoteControlServer, ExecutionMode)
Expand Down Expand Up @@ -57,6 +61,8 @@

IGOR_PATH = IGOR_DIR / 'windows'/ 'x64' / 'igor.exe'

BUILD_FILE_PATH = USER_DIR / "build.bff"

SANDBOXED_PLATFORMS = ['windows', 'mac', 'linux']

class IgorRunTestsCommand(BaseCommand):
Expand Down Expand Up @@ -128,6 +134,10 @@ def validate_yyp(input) -> Path:
parser.add_argument('-rv', '--runtime-version', type=validate_version, default=None, help='Runner version to use (default: <latest>)')
parser.add_argument('-rn', '--run-name', default='xUnit', help='The name to be given to the test run')
parser.add_argument('-h5r', '--html5-runner', type=partial(validate_path, arg='--html5-runner', required=False), required=False, help='A custom HTML5 runner to use instead of the runtime one')
# Custom GMPM registry information
parser.add_argument('-gmpmreg', '--gmpm-registry', type=str, required=False, default='https://gmpm.gamemaker.io/', help='What registry to use when fetching gamemaker packages')
parser.add_argument('-gmpmusr', '--gmpm-username', type=str, required=False, default=None, help='Username to be used for custom GMPM registry')
parser.add_argument('-gmpmpsw', '--gmpm-password', type=str, required=False, default=None, help='Password to be used for custom GMPM registry')

parser.set_defaults(command_class=cls)

Expand Down Expand Up @@ -204,7 +214,17 @@ async def execute(self):
core_resources_path = runtime_path / 'bin' / 'assetcompiler' / 'windows' / 'x64' / 'CoreResources.dll'
assert(core_resources_path.exists())

await async_utils.run_and_capture(NODEJS_NPM_PATH, ["install", "--reg=https://gmpm.gamemaker.io/", "@gm-tools/project-tool-win-x64", "--no-save"])
# Setup NPM registry and credentials
registry = self.get_argument('gmpm_registry') or "https://gmpm.gamemaker.io/"
username = self.get_argument('gmpm_username')
password = self.get_argument('gmpm_password')

if username and password:
token = self.verdaccio_login(registry, username, password)
if token:
self.npm_set_auth(registry, token)

await async_utils.run_and_capture(NODEJS_NPM_PATH, ["install", f"--reg={registry}", "@gm-tools/project-tool-win-x64", "--no-save"])
project_tool_path = NODE_MODULES_DIR / '@gm-tools' / 'project-tool-win-x64' / 'ProjectTool.exe'
assert(project_tool_path.exists())

Expand Down Expand Up @@ -305,6 +325,82 @@ def remove_directory(self, directory: Path):
else:
LOGGER.warning(f'Directory does not exist: {directory}')

def find_npm(self) -> str:
npm = shutil.which("npm") or shutil.which("npm.cmd")
if not npm:
print("Could not find 'npm' on PATH. Make sure Node.js is installed.")
sys.exit(1)
return npm

def verdaccio_login(self, registry: str, username: str, password: str) -> str | None:
"""
Equivalent to VerdaccioRegistryLogin in C#:
PUT <registry>/-/user/org.couchdb.user:{username}
with Basic auth and JSON body { name, password }
expects JSON with a 'token' field.
"""
base = registry.rstrip("/") + "/"
url = base + f"-/user/org.couchdb.user:{username}"

auth_b64 = base64.b64encode(f"{username}:{password}".encode("utf-8")).decode("ascii")
headers = {
"Authorization": f"Basic {auth_b64}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {"name": username, "password": password}

print(f"Logging in to Verdaccio at: {url}")
resp = requests.put(url, headers=headers, data=json.dumps(payload), timeout=15)

if not (200 <= resp.status_code < 300):
print(f"Login failed: {resp.status_code}")
print(resp.text)
return None

try:
data = resp.json()
except ValueError:
print("Login response was not valid JSON:")
print(resp.text)
return None

token = data.get("token")
if not token:
print("Login succeeded but 'token' not found in response:")
print(data)
return None

print("Login succeeded, got token from Verdaccio.")
return token

def npm_set_auth(self, registry: str, token: str, userconfig: str | None = None) -> int:
"""
Equivalent of your C# NPMSetAuth:
npm set //host/:_authToken <token>

If userconfig is provided, we write to that .npmrc instead of the default.
"""
npm = self.find_npm()
host = urlparse(registry).netloc

cmd = [npm, "config", "set", f"//{host}/:_authToken", token]
env = os.environ.copy()

if userconfig:
env["NPM_CONFIG_USERCONFIG"] = userconfig

print("\nSetting npm auth token with:")
print(" ", " ".join(cmd))

result = subprocess.run(cmd, env=env, capture_output=True, text=True)
if result.stdout:
print(result.stdout)
if result.stderr:
print(result.stderr, file=sys.stderr)
print(f"npm config set exit code: {result.returncode}")
return result.returncode

def ensure_directories_exist(self, directories: list[Path]):
for directory in directories:
if not directory.exists():
Expand Down Expand Up @@ -425,8 +521,16 @@ async def igor_run_tests(self, igor_path: Path, project_file: Path, user_folder:
# Setup verbosity level
args_base = ['/v' for _ in range(verbosity_level)]

# Write build file
build_options = {
"prefabs": str(PREFABS_DIR),
"applicationPath": "applicationPath"
}
file_utils.save_data_as_json(build_options, BUILD_FILE_PATH)

# Setup arguments
args_base += [
f'-options={BUILD_FILE_PATH}',
f'/uf={user_folder}',
f'/rp={runtime_path}',
f'/project={project_file}',
Expand Down
Binary file not shown.
27 changes: 27 additions & 0 deletions prefabs/io.gamemaker.gm_filter_hue-1.0.0/datafiles/filterdef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "_filter_hue",
"displayname": "filter_hue",
"type": "filter",
"parameters": [
{
"name": "g_HueShift",
"displayname": "Hue Shift",
"type": "float",
"elements": 1,
"arraysize": 0,
"default": 0.5,
"min": 0.0,
"max": 1.0
},
{
"name": "g_HueSaturation",
"displayname": "Saturation",
"type": "float",
"elements": 1,
"arraysize": 0,
"default": 1.0,
"min": 0.0,
"max": 5.0
}
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions prefabs/io.gamemaker.gm_filter_hue-1.0.0/prefab.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$PrefabMetadata":"v2",
"Author":"GameMaker",
"Description":"GameMaker Hue Filter",
"DisplayName":"Hue Filter",
"Exports":[
{"$PrefabExportMetadata":"v3","AssetName":"_filter_hue_shader","Description":"Shader","DisplayName":"_filter_hue_shader","FolderPath":"Shaders","ResourceType":"GMShader","ResourceVersion":0,},
],
"PackageId":"io.gamemaker.gm_filter_hue",
"Version":"1.0.0",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
"Hue & Saturation" by Xor

Hue shift and saturation control

This filter converts the colour to YIQ colour space, rotates the hue and scales saturation,
then converts the colour back to RGB colour space.

You can even increase the saturation level above 1.0 to boost saturation!
*/

varying vec2 v_vTexcoord;
varying vec4 v_vColour;

//Hue shift amount (0.0 = no shift, to 1.0 = full shift)
uniform float g_HueShift;
//Saturation level (0.0 = no saturation, to 1.0 = full colour, higher = more saturation)
uniform float g_HueSaturation;

//Tau (pi*2) for trig math
#define TAU 6.283185

//Hue shift by transforming YIQ colour space: en.wikipedia.org/wiki/YIQ
//Inputs are colour, hue shift angle (radians) and saturation multiplier
vec3 hue(vec3 col, float ang, float sat)
{
//Colour conversion matrices
const mat3 RGBtoYIQ = mat3(0.299, 0.587, 0.114,
0.596, -0.275, -0.321,
0.212, -0.523, 0.311);

const mat3 YIQtoRGB = mat3(1.0, 0.956, 0.621,
1.0, -0.272, -0.647,
1.0, -1.107, 1.704);
//Compute YIQ colour
vec3 YIQ = col * RGBtoYIQ;
//Rotate I and Q chrominance values and scale for saturation
YIQ.yz *= mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sat;

//Convert back to RGB colour space
return YIQ * YIQtoRGB;
}

void main()
{
//Sample base texture
vec4 colour = texture2D(gm_BaseTexture, v_vTexcoord);

//Hue shift and saturation
colour.rgb = hue(colour.rgb, g_HueShift * TAU, g_HueSaturation);

//Output result with vertex colour factored
gl_FragColor = v_vColour * colour;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
"Hue & Saturation" by Xor

A generic vertex passthrough shader.
*/
attribute vec3 in_Position;
attribute vec4 in_Colour;
attribute vec2 in_TextureCoord;

varying vec2 v_vTexcoord;
varying vec4 v_vColour;

void main()
{
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xy, 0.0, 1.0);

v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions prefabs/io.gamemaker.gm_filter_hue-1.0.0/yymanifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<files>
<file md5="D9C4589C5B627C9CAE8048F296EBC923">io.gamemaker.gm_filter_hue-1.0.0.resource_order</file>
<file md5="7111DD726F94652853BE90A7FD5D6E0E">io.gamemaker.gm_filter_hue-1.0.0.yyp</file>
<file md5="54FE2A4B32FA761D8C5842708A279E81">prefab.json</file>
<file md5="D223FCE8A2CD9E9C991A80AB445AF960">datafiles\filterdef.json</file>
<file md5="D6A3FD4D2B364D774A49CDA42A448646">datafiles\_filter_hue.fxb</file>
<file md5="A2AFD41FF76131DAFC86BA8636A1733E">shaders\_filter_hue_shader\_filter_hue_shader.fsh</file>
<file md5="78D67EB996D2E833C98294C1969F67A5">shaders\_filter_hue_shader\_filter_hue_shader.vsh</file>
<file md5="A9D69B258A345D23EA0514AA9FF42435">shaders\_filter_hue_shader\_filter_hue_shader.yy</file>
</files>
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading