CrossByte CI | push | main #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CrossByte CI | |
| run-name: CrossByte CI | ${{ github.event_name }} | ${{ github.ref_name }} | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| HAXE_VERSION: "4.3.7" | |
| HXCPP_REPO: "https://github.com/dimensionscape/hxcpp.git" | |
| HXCPP_REF: "socket-fixes" | |
| jobs: | |
| core-tests: | |
| name: Core | Haxe Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Haxe | |
| uses: krdlab/setup-haxe@v1 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - name: Install test dependencies | |
| run: haxelib install utest --quiet | |
| - name: Run interpreter test suite | |
| run: haxe ci/interp-tests.hxml | |
| - name: Validate sample builds | |
| run: | | |
| set -euo pipefail | |
| while IFS= read -r sample; do | |
| echo "::group::${sample}" | |
| (cd "$(dirname "$sample")" && haxe "$(basename "$sample")") | |
| echo "::endgroup::" | |
| done < <(find samples -name check.hxml -print | sort) | |
| docs: | |
| name: Core | API Docs | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Haxe | |
| uses: krdlab/setup-haxe@v1 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - name: Install doc dependencies | |
| run: | | |
| haxelib install dox --quiet | |
| haxelib git hxcpp ${{ env.HXCPP_REPO }} ${{ env.HXCPP_REF }} | |
| - name: Build API XML | |
| run: | | |
| rm -rf export/docs-api export/docs-site | |
| mkdir -p export/docs-api export/docs-site | |
| haxe ci/docs-api.hxml | |
| - name: Generate docs site | |
| run: | | |
| haxelib run dox \ | |
| -i export/docs-api/crossbyte.xml \ | |
| -o export/docs-site \ | |
| --title CrossByte \ | |
| --toplevel-package crossbyte \ | |
| --include '^crossbyte(\.|$)' \ | |
| --exclude '\._internal(\.|$)' \ | |
| -D version "${GITHUB_REF_NAME}" \ | |
| -D source-path "https://github.com/dimensionscape-llc/crossbyte/blob/${GITHUB_SHA}/src/" \ | |
| -D website "https://github.com/dimensionscape-llc/crossbyte" \ | |
| -D logo crossbyte.png \ | |
| -D description "CrossByte API reference" | |
| - name: Upload docs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: crossbyte-api-docs | |
| path: export/docs-site | |
| if-no-files-found: error | |
| cpp-audit: | |
| name: Core | hxcpp API Audit | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Haxe | |
| uses: krdlab/setup-haxe@v1 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - name: Install hxcpp | |
| run: haxelib git hxcpp ${{ env.HXCPP_REPO }} ${{ env.HXCPP_REF }} | |
| - name: Bootstrap hxcpp tools | |
| run: | | |
| set -euo pipefail | |
| HXCPP_DIR="$(haxelib path hxcpp | head -n 1)" | |
| (cd "$HXCPP_DIR/tools/run" && haxe compile.hxml) | |
| (cd "$HXCPP_DIR/tools/hxcpp" && haxe compile.hxml) | |
| - name: Type-check C++ API surface | |
| run: haxe ci/cpp-api-audit.hxml | |
| - name: Type-check timer burst support | |
| run: haxe ci/cpp-timer-burst-audit.hxml | |
| native-smoke: | |
| name: Core | Native Smoke | |
| runs-on: windows-latest | |
| timeout-minutes: 25 | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Haxe | |
| uses: krdlab/setup-haxe@v1 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - name: Install native dependencies | |
| run: | | |
| haxelib install utest --quiet | |
| haxelib git hxcpp ${{ env.HXCPP_REPO }} ${{ env.HXCPP_REF }} | |
| - name: Bootstrap hxcpp tools | |
| run: | | |
| $hxcppDir = (haxelib path hxcpp | Select-Object -First 1).Trim() | |
| Push-Location (Join-Path $hxcppDir "tools/run") | |
| haxe compile.hxml | |
| Pop-Location | |
| Push-Location (Join-Path $hxcppDir "tools/hxcpp") | |
| haxe compile.hxml | |
| Pop-Location | |
| - name: Build native smoke harness | |
| run: haxe ci/native-tests.hxml | |
| - name: Run native smoke suite | |
| run: .\export\ci-native-tests\NativeSmokeMain.exe | |
| - name: Build native samples | |
| run: | | |
| Get-ChildItem samples -Recurse -Filter *.hxml | | |
| Where-Object { $_.Name -ne 'check.hxml' } | | |
| Sort-Object FullName | | |
| ForEach-Object { | |
| Write-Host "::group::$($_.FullName)" | |
| Push-Location $_.DirectoryName | |
| haxe $_.Name | |
| Pop-Location | |
| Write-Host "::endgroup::" | |
| } | |
| extensions: | |
| name: Extensions | ${{ matrix.label }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - label: libuv Poll Backend | |
| repo: DimensionscapeOrg/crossbyte-libuv | |
| path: crossbyte-libuv | |
| haxelib_name: crossbyte-libuv | |
| native_deps: sudo apt-get update && sudo apt-get install -y libuv1-dev | |
| native_test_binary: ../crossbyte/export/crossbyte-libuv-native-test/LibuvNativeTestMain | |
| - label: Brotli Native Oracle | |
| repo: DimensionscapeOrg/crossbyte-brotli | |
| path: crossbyte-brotli | |
| haxelib_name: crossbyte-brotli | |
| native_deps: "" | |
| native_test_binary: ../crossbyte/export/crossbyte-brotli-native-test/NativeBrotliTestMain | |
| - label: LZ4 Native Oracle | |
| repo: DimensionscapeOrg/crossbyte-lz4 | |
| path: crossbyte-lz4 | |
| haxelib_name: crossbyte-lz4 | |
| native_deps: "" | |
| native_test_binary: ../crossbyte/export/crossbyte-lz4-native-test/NativeLz4TestMain | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout CrossByte | |
| uses: actions/checkout@v4 | |
| with: | |
| path: crossbyte | |
| - name: Checkout ${{ matrix.haxelib_name }} | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ matrix.repo }} | |
| path: ${{ matrix.path }} | |
| - name: Setup Haxe | |
| uses: krdlab/setup-haxe@v1 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - name: Install platform dependencies | |
| if: ${{ matrix.native_deps != '' }} | |
| run: ${{ matrix.native_deps }} | |
| - name: Install Haxelibs | |
| run: | | |
| haxelib install utest --quiet | |
| haxelib git hxcpp ${{ env.HXCPP_REPO }} ${{ env.HXCPP_REF }} | |
| haxelib dev ${{ matrix.haxelib_name }} "$GITHUB_WORKSPACE/${{ matrix.path }}" | |
| - name: Bootstrap hxcpp tools | |
| run: | | |
| set -euo pipefail | |
| HXCPP_DIR="$(haxelib path hxcpp | head -n 1)" | |
| (cd "$HXCPP_DIR/tools/run" && haxe compile.hxml) | |
| (cd "$HXCPP_DIR/tools/hxcpp" && haxe compile.hxml) | |
| - name: Run extension interpreter tests | |
| working-directory: ${{ matrix.path }} | |
| run: haxe test.hxml | |
| - name: Build extension native tests | |
| working-directory: ${{ matrix.path }} | |
| run: haxe native-test.hxml | |
| - name: Run extension native tests | |
| working-directory: ${{ matrix.path }} | |
| run: ${{ matrix.native_test_binary }} |