From e13efbdbc1cbdfcc5c55d545c6d73afc60dba551 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 19:51:12 +0100 Subject: [PATCH 1/7] Add GitHub Actions workflow for build validation Runs HEMTT check and build on PRs and pushes to main to ensure: - Code passes linting checks - Project builds successfully Build artifacts are uploaded for 7 days for testing. --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f1036c3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + + - name: Run HEMTT check + run: hemtt check + + - name: Run HEMTT build + run: hemtt build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ocap-build + path: .hemttout/build/ + retention-days: 7 From 7d8a3d3d852a9fcb6f3910ef301b719ea781a2ad Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 19:57:20 +0100 Subject: [PATCH 2/7] test: Add lint warning to test CI workflow --- addons/database/fnc_initDB.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/database/fnc_initDB.sqf b/addons/database/fnc_initDB.sqf index a516981..300f232 100644 --- a/addons/database/fnc_initDB.sqf +++ b/addons/database/fnc_initDB.sqf @@ -19,7 +19,7 @@ addMissionEventHandler ["ExtensionCallback", { private _data = parseSimpleArray _dataArr; - TRACE_3("ExtensionCallback",_name,_function,_data); + TRACE_3("ExtensionCallback", _name, _function, _data); if (_function isEqualTo ":VERSION:") exitWith { // version return is automatic during extension init process From 0616463acc4459e38aaaa37a5172c54c0bf375cd Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 19:58:29 +0100 Subject: [PATCH 3/7] revert: Remove test lint warning --- addons/database/fnc_initDB.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/database/fnc_initDB.sqf b/addons/database/fnc_initDB.sqf index 300f232..a516981 100644 --- a/addons/database/fnc_initDB.sqf +++ b/addons/database/fnc_initDB.sqf @@ -19,7 +19,7 @@ addMissionEventHandler ["ExtensionCallback", { private _data = parseSimpleArray _dataArr; - TRACE_3("ExtensionCallback", _name, _function, _data); + TRACE_3("ExtensionCallback",_name,_function,_data); if (_function isEqualTo ":VERSION:") exitWith { // version return is automatic during extension init process From 7fc18e950facae47d9c719c289c3051f34cd66cb Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 20:02:25 +0100 Subject: [PATCH 4/7] Fail CI on critical lint warnings (PW1, PW3, FNL) - Update workflow to check for critical warnings that indicate code issues - Suppress optimization suggestions (if_assign, select_parse_number) in project.toml - Critical warnings: PW1 (macro redefinition), PW3 (macro padding), FNL (missing newline) --- .github/workflows/build.yml | 12 +++++++++++- .hemtt/project.toml | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1036c3..98b9c81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,17 @@ jobs: uses: arma-actions/hemtt@v1 - name: Run HEMTT check - run: hemtt check + run: | + # Run hemtt check and capture output + OUTPUT=$(hemtt check 2>&1) || true + echo "$OUTPUT" + + # Check for critical warnings that should fail the build + # PW1: macro redefinition, PW3: macro padding, FNL: missing newline + if echo "$OUTPUT" | grep -E "warning\[(PW1|PW3|FNL)\]"; then + echo "::error::Critical lint warnings found (PW1/PW3/FNL)" + exit 1 + fi - name: Run HEMTT build run: hemtt build diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 5fd5250..ca67668 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -15,3 +15,6 @@ command_case = false banned_commands = false undefined = false format_args = false +# Optimization suggestions - not critical +if_assign = false +select_parse_number = false From 61c848b929909bc02111edaad079f6a60eadbfe8 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 20:02:39 +0100 Subject: [PATCH 5/7] test: Add PW3 warning to verify CI fails --- addons/database/fnc_initDB.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/database/fnc_initDB.sqf b/addons/database/fnc_initDB.sqf index a516981..300f232 100644 --- a/addons/database/fnc_initDB.sqf +++ b/addons/database/fnc_initDB.sqf @@ -19,7 +19,7 @@ addMissionEventHandler ["ExtensionCallback", { private _data = parseSimpleArray _dataArr; - TRACE_3("ExtensionCallback",_name,_function,_data); + TRACE_3("ExtensionCallback", _name, _function, _data); if (_function isEqualTo ":VERSION:") exitWith { // version return is automatic during extension init process From cbf891273732cd885c32b4e60e9506d572cf94da Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 20:03:38 +0100 Subject: [PATCH 6/7] revert: Remove test PW3 warning --- addons/database/fnc_initDB.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/database/fnc_initDB.sqf b/addons/database/fnc_initDB.sqf index 300f232..a516981 100644 --- a/addons/database/fnc_initDB.sqf +++ b/addons/database/fnc_initDB.sqf @@ -19,7 +19,7 @@ addMissionEventHandler ["ExtensionCallback", { private _data = parseSimpleArray _dataArr; - TRACE_3("ExtensionCallback", _name, _function, _data); + TRACE_3("ExtensionCallback",_name,_function,_data); if (_function isEqualTo ":VERSION:") exitWith { // version return is automatic during extension init process From a6c81d898509d096fd9c6e2f31cca672ead6f0a5 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Tue, 3 Feb 2026 20:09:13 +0100 Subject: [PATCH 7/7] Fail on all warnings except L-S29 L-S29 warnings are false positives for functions that are dynamically defined at runtime via missionNamespace setVariable. --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98b9c81..64af6a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,10 +23,13 @@ jobs: OUTPUT=$(hemtt check 2>&1) || true echo "$OUTPUT" - # Check for critical warnings that should fail the build - # PW1: macro redefinition, PW3: macro padding, FNL: missing newline - if echo "$OUTPUT" | grep -E "warning\[(PW1|PW3|FNL)\]"; then - echo "::error::Critical lint warnings found (PW1/PW3/FNL)" + # Filter out L-S29 (false positives for dynamically defined functions) + # and fail if any other warnings remain + WARNINGS=$(echo "$OUTPUT" | grep -E "warning\[" | grep -v "L-S29" || true) + if [ -n "$WARNINGS" ]; then + echo "" + echo "::error::Lint warnings found:" + echo "$WARNINGS" exit 1 fi