| name: linux | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: ["*.*.*"] | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Ccache | |
| id: compiler-cache | |
| uses: ./.github/actions/compiler-cache | |
| with: | |
| key: ${{ github.workflow }}-${{ runner.os }}-${{ runner.arch }} | |
| max-size: 1G | |
| - name: Install Dependencies | |
| run: | | |
| sudo rm -f /etc/apt/sources.list.d/google-chrome.list | |
| sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | |
| sudo apt-get update | |
| sudo apt-get install \ | |
| gcc \ | |
| gobject-introspection \ | |
| libcairo2-dev \ | |
| libchafa-dev \ | |
| libfreetype6-dev \ | |
| libgirepository1.0-dev \ | |
| libglib2.0-dev \ | |
| libgraphite2-dev \ | |
| libicu-dev \ | |
| libpng-dev \ | |
| libglew-dev \ | |
| libglfw3-dev \ | |
| libgl-dev \ | |
| pkg-config \ | |
| zlib1g-dev \ | |
| help2man | |
| - name: Install wasm-micro-runtime | |
| run: | | |
| # WAMR-2.4.6. The Wasm shaper limits what a module can run by | |
| # counting instructions. With SIMD the configure step downloads | |
| # another library. | |
| git init -q "$RUNNER_TEMP/wamr" | |
| git -C "$RUNNER_TEMP/wamr" fetch -q --depth=1 \ | |
| https://github.com/bytecodealliance/wasm-micro-runtime \ | |
| 0fa421193212b3fb45c7f59ec53662cc2851fcc7 | |
| git -C "$RUNNER_TEMP/wamr" checkout -q FETCH_HEAD | |
| cmake -S "$RUNNER_TEMP/wamr" -B "$RUNNER_TEMP/wamr/build" \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DBUILD_SHARED_LIBS=ON \ | |
| -DWAMR_BUILD_INSTRUCTION_METERING=1 \ | |
| -DWAMR_BUILD_SIMD=0 | |
| cmake --build "$RUNNER_TEMP/wamr/build" --parallel | |
| sudo cmake --install "$RUNNER_TEMP/wamr/build" | |
| sudo ldconfig | |
| - name: Setup Python | |
| uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python Dependencies | |
| run: pip3 install -r .ci/requirements.txt --require-hashes | |
| - name: Setup Meson | |
| run: | | |
| ccache --version | |
| meson setup build \ | |
| -Dauto_features=enabled \ | |
| -Dgraphite=enabled \ | |
| -Dkbts=enabled \ | |
| -Dwasm=enabled \ | |
| -Doptimization=2 \ | |
| -Ddocs=disabled \ | |
| -Dragel_subproject=true | |
| - name: Build | |
| run: meson compile -Cbuild | |
| - name: Test | |
| run: meson test --print-errorlogs -Cbuild | |
| - name: Dist | |
| run: | | |
| git reset --hard HEAD # ragel may have modified the source tree | |
| meson dist --no-tests -Cbuild | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: harfbuzz | |
| path: build/meson-dist/harfbuzz-*.tar.xz | |
| if-no-files-found: error | |
| - name: Test the Wasm shaper without its limits | |
| run: | | |
| # Some of what test-wasm.c checks is only there without them: | |
| # a module with an allocator of its own is not run with them. | |
| meson setup build-wasm-no-limits \ | |
| -Dauto_features=disabled \ | |
| -Dglib=enabled \ | |
| -Dtests=enabled \ | |
| -Dwasm=enabled \ | |
| -Doptimization=2 \ | |
| -Ddocs=disabled \ | |
| -Dcpp_args=-DHB_NO_WASM_BUDGET | |
| meson compile -Cbuild-wasm-no-limits test-wasm | |
| meson test --print-errorlogs -Cbuild-wasm-no-limits test-wasm | |
| - name: Test the Rust toolkit for Wasm modules | |
| run: | | |
| rustup target add wasm32-unknown-unknown | |
| export CARGO_TARGET_DIR="$RUNNER_TEMP/wasm-rust" | |
| toolkit=src/wasm/rust/harfbuzz-wasm | |
| cargo build --locked --manifest-path $toolkit/Cargo.toml \ | |
| --target wasm32-unknown-unknown | |
| cargo build --locked --manifest-path $toolkit/Cargo.toml \ | |
| --target wasm32-unknown-unknown --features kurbo --example test_module | |
| cargo build --locked \ | |
| --manifest-path src/wasm/sample/rust/hello-wasm/Cargo.toml \ | |
| --target wasm32-unknown-unknown | |
| # The test module tells what it found, a glyph for each check, | |
| # without features and with. It is a debug build, and stops | |
| # where the toolkit hands something it may not to the standard | |
| # library. | |
| python3 src/addTable.py test/api/fonts/Roboto-Regular.abc.ttf \ | |
| "$RUNNER_TEMP/test_module.ttf" \ | |
| "$CARGO_TARGET_DIR/wasm32-unknown-unknown/debug/examples/test_module.wasm" | |
| for features in "" kern; do | |
| answer=$(build/util/hb-shape --shapers=wasm --features="$features" \ | |
| --no-glyph-names --no-clusters --no-positions \ | |
| "$RUNNER_TEMP/test_module.ttf" a) | |
| echo "$answer" | |
| test "$answer" = "[1|1|1|1|1|1|1|1|1]" | |
| done | |
| - name: Save Compiler Cache | |
| if: ${{ !cancelled() && steps.compiler-cache.outcome == 'success' }} | |
| uses: ./.github/actions/save-compiler-cache | |
| with: | |
| key: ${{ steps.compiler-cache.outputs.key }} | |
| variant: ${{ steps.compiler-cache.outputs.variant }} | |
| start: ${{ steps.compiler-cache.outputs.start }} | |
| release: | |
| name: Create and populate release | |
| permissions: | |
| contents: write | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| if: contains(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: harfbuzz | |
| - name: Check for release | |
| id: create_release | |
| run: | | |
| if ! gh release view ${{ github.ref_name }}; then | |
| python3 src/check-release-notes.py NEWS ${{ github.ref_name }} > RELEASE_NOTES | |
| gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file RELEASE_NOTES | |
| fi | |
| - name: Populate release | |
| run: | | |
| gh release upload ${{ github.ref_name }} harfbuzz-${{ github.ref_name }}.tar.xz --clobber |