From 2a566eac518b1e03e69feff1d7d0a7792d270860 Mon Sep 17 00:00:00 2001 From: Hyper_ <40342021+NotHyper-474@users.noreply.github.com> Date: Fri, 15 May 2026 22:28:41 -0300 Subject: [PATCH 01/15] ci: Build Actions for Sample Projects --- .github/workflows/build-samples.yml | 93 ++++++++++++++++++ include.xml | 3 + polymod/Polymod.hx | 7 ++ polymod/backends/HEAPSBackend.hx | 13 ++- polymod/backends/LimeBackend.hx | 2 +- polymod/backends/NMEBackend.hx | 5 + polymod/backends/PolymodAssetLibrary.hx | 4 +- polymod/fs/MemoryZipFileSystem.hx | 4 +- .../hscript/_internal/PolymodScriptClass.hx | 2 + samples/flixel/hmm.json | 4 +- samples/flixel_zip/hmm.json | 21 +++- samples/heaps/hmm.json | 26 ++++- samples/heaps/res/data/greeting.txt | 1 + samples/heaps/res/data/objects.json | 6 ++ samples/heaps/res/data/objects.xml | 6 ++ samples/heaps/res/img/a.png | Bin 0 -> 878 bytes samples/heaps/res/img/b.png | Bin 0 -> 900 bytes samples/heaps/res/img/c.png | Bin 0 -> 902 bytes samples/nme/hmm.json | 18 +++- samples/openfl/hmm.json | 25 ++++- samples/openfl_firetongue/hmm.json | 23 ++++- samples/openfl_hscript/hmm.json | 23 ++++- samples/openfl_hscript_class/hmm.json | 23 ++++- 23 files changed, 284 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build-samples.yml create mode 100644 samples/heaps/res/data/greeting.txt create mode 100644 samples/heaps/res/data/objects.json create mode 100644 samples/heaps/res/data/objects.xml create mode 100644 samples/heaps/res/img/a.png create mode 100644 samples/heaps/res/img/b.png create mode 100644 samples/heaps/res/img/c.png diff --git a/.github/workflows/build-samples.yml b/.github/workflows/build-samples.yml new file mode 100644 index 00000000..6f70cf2d --- /dev/null +++ b/.github/workflows/build-samples.yml @@ -0,0 +1,93 @@ +# Builds the sample projects on multiple targets to check for compiler errors. + +name: Build Samples + +# Controls when the workflow will run +on: + push: + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + target: [cpp, html5, hl] + fail-fast: false + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v6.0.2 + + - name: Setup Haxe + uses: krdlab/setup-haxe@v2 + with: + haxe-version: 4.3.7 + + - name: Setup HMM + # Workaround for an error on the Windows target + env: + HAXEPATH: ${{ env.HAXE_STD_PATH }}/.. + run: | + haxelib --global --quiet install hmm + haxelib --global run hmm setup + + - name: Install sample dependencies + shell: bash + run: | + for sample in samples/*; do + if [ -d "$sample" ] && [ -f "$sample/hmm.json" ]; then + echo "Installing dependencies for $sample" + (cd "$sample" && haxelib run hmm install --quiet) + fi + done + + - name: Build Flixel Sample + working-directory: ./samples/flixel + run: | + haxelib run lime build ${{ matrix.target }} --no-output + + - name: Build ZIP Flixel Sample + working-directory: ./samples/flixel_zip + run: | + haxelib run lime build ${{ matrix.target }} --no-output + + - name: Build Heaps Sample + if: matrix.target == 'hl' + working-directory: ./samples/heaps + run: | + haxe hl.hxml + + - name: Build NME Sample + if: matrix.target != 'hl' + working-directory: ./samples/nme + run: | + haxelib update --always --quiet + echo y | haxelib run nme build ${{ matrix.target }} + + - name: Build OpenFL Sample + working-directory: ./samples/openfl + run: | + haxelib run openfl build ${{ matrix.target }} --no-output + + - name: Build OpenFL (Firetongue) Sample + working-directory: ./samples/openfl_firetongue + run: | + haxelib run lime build ${{ matrix.target }} --no-output + + - name: Build OpenFL (HScript) Sample + working-directory: ./samples/openfl_hscript + run: | + haxelib run openfl build ${{ matrix.target }} --no-output + + - name: Build OpenFL (HScript with Classes) Sample + working-directory: ./samples/openfl_hscript_class + run: | + haxelib run openfl build ${{ matrix.target }} --no-output + + diff --git a/include.xml b/include.xml index e28dae2b..9e3d2b98 100644 --- a/include.xml +++ b/include.xml @@ -1,6 +1,9 @@ + + +