|
| 1 | +name: "Run Haxe test/Test.hxml" |
| 2 | +description: "Runs Haxe test/Test.hxml on JS, C++, and HashLink" |
| 3 | + |
| 4 | +inputs: |
| 5 | + haxe-version: |
| 6 | + required: true |
| 7 | + description: "The version of the Haxe compiler to use." |
| 8 | + |
| 9 | +runs: |
| 10 | + using: "composite" |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Install Haxe |
| 16 | + uses: krdlab/setup-haxe@v1 |
| 17 | + with: |
| 18 | + haxe-version: ${{ inputs.haxe-version }} |
| 19 | + |
| 20 | + - name: Check Haxe |
| 21 | + run: haxe -version |
| 22 | + shell: bash |
| 23 | + |
| 24 | + # ------------------------------------------- |
| 25 | + # JavaScript |
| 26 | + |
| 27 | + - name: Install Node |
| 28 | + uses: actions/setup-node@v4 |
| 29 | + |
| 30 | + - name: Check Node |
| 31 | + run: node -v |
| 32 | + shell: bash |
| 33 | + |
| 34 | + - name: Compile Test for JS |
| 35 | + run: haxe Test.hxml -js Test.js |
| 36 | + working-directory: test |
| 37 | + shell: bash |
| 38 | + |
| 39 | + - name: Test JS |
| 40 | + run: node Test.js |
| 41 | + working-directory: test |
| 42 | + shell: bash |
| 43 | + |
| 44 | + # ------------------------------------------- |
| 45 | + # C++ |
| 46 | + # Note: hxcpp currently doesn't work on Haxe 5 (latest) |
| 47 | + |
| 48 | + - name: Setup Hxcpp |
| 49 | + if: ${{ inputs.haxe-version != 'latest' }} |
| 50 | + run: haxelib install hxcpp |
| 51 | + shell: bash |
| 52 | + |
| 53 | + - name: Compile Test for C++ |
| 54 | + if: ${{ inputs.haxe-version != 'latest' }} |
| 55 | + run: haxe Test.hxml -cpp bin |
| 56 | + working-directory: test |
| 57 | + shell: bash |
| 58 | + |
| 59 | + - name: Test C++ |
| 60 | + if: ${{ inputs.haxe-version != 'latest' }} |
| 61 | + run: ./bin/Test |
| 62 | + working-directory: test |
| 63 | + shell: bash |
| 64 | + |
| 65 | + # ------------------------------------------- |
| 66 | + # HashLink |
| 67 | + |
| 68 | + - name: Setup HashLink |
| 69 | + |
| 70 | + |
| 71 | + - name: Compile Test for HashLink |
| 72 | + run: haxe Test.hxml -hl Test.hl |
| 73 | + working-directory: test |
| 74 | + shell: bash |
| 75 | + |
| 76 | + - name: Test HashLink |
| 77 | + run: hl Test.hl |
| 78 | + working-directory: test |
| 79 | + shell: bash |
0 commit comments