ladybird/.github/workflows/js-artifacts.yml
Jelle Raaijmakers 37b8ab54df CI+CMake: Remove most of the *_CI CMake presets
These existed because of their `vcpkg_ci` base preset, whose goal was to
enable vcpkg-supported caching on GitHub. We now handle vcpkg caching in
the CI steps, removing the necessity for all these *_CI preset variants.

This allows us to reuse `inputs.build_preset` in the test step, and we
can do away with the Windows-specific test step since it is now almost
identical to the Linux/macOS test step.

I've left in the Windows_CI presets, because that one actually results
in a different set of compiled files compared to the
Windows_Experimental presets.
2025-07-09 15:32:57 -06:00

113 lines
3.7 KiB
YAML

name: Package the js repl as a binary artifact
on:
push:
branches: [master]
env:
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
jobs:
build-and-package:
runs-on: ${{ fromJSON(matrix.runner_labels) }}
if: github.repository == 'LadybirdBrowser/ladybird'
name: ${{ matrix.os_name }}, ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
os_name: ['Linux']
arch: ['x86_64']
toolchain: ['Clang']
package_type: ['Linux-x86_64']
runner_labels: ['["blacksmith-8vcpu-ubuntu-2404"]']
include:
- os_name: 'macOS'
arch: 'arm64'
toolchain: 'Clang'
package_type: 'macOS-arm64'
runner_labels: '["macos-15", "self-hosted"]'
- os_name: 'Linux'
arch: 'arm64'
toolchain: 'Clang'
package_type: 'Linux-aarch64'
runner_labels: '["blacksmith-8vcpu-ubuntu-2404-arm"]'
steps:
- name: Checkout LadybirdBrowser/ladybird
uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/actions/setup
with:
os: ${{ matrix.os_name }}
arch: ${{ matrix.arch }}
- name: Restore Caches
uses: ./.github/actions/cache-restore
id: 'cache-restore'
with:
runner_labels: ${{ matrix.runner_labels }}
os: ${{ matrix.os_name }}
arch: ${{ matrix.arch }}
cache_key_extra: 'LibJS Artifacts'
ccache_path: ${{ env.CCACHE_DIR }}
download_cache_path: ${{ github.workspace }}/Build/caches
vcpkg_cache_path: ${{ github.workspace }}/Build/caches/vcpkg-binary-cache
- name: Create build directory Ubuntu
run: |
cmake --preset Distribution \
-DCMAKE_C_COMPILER=clang-20 \
-DCMAKE_CXX_COMPILER=clang++-20 \
-DENABLE_GUI_TARGETS=OFF
if: ${{ matrix.os_name == 'Linux' }}
# FIXME: Add the following flag back when vcpkg supports Universal binaries:
# -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
#
# See: https://github.com/microsoft/vcpkg/discussions/19454
- name: Create build directory macOS
run: |
cmake --preset Distribution \
-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
-DENABLE_GUI_TARGETS=OFF
if: ${{ matrix.os_name == 'macOS' }}
- name: Build and package js
working-directory: Build/distribution
run: |
ninja js
cpack
- name: Save Caches
uses: ./.github/actions/cache-save
with:
runner_labels: ${{ matrix.runner_labels }}
arch: 'Lagom'
ccache_path: ${{ env.CCACHE_DIR }}
ccache_primary_key: ${{ steps.cache-restore.outputs.ccache_primary_key }}
vcpkg_cache_path: ${{ github.workspace }}/Build/caches/vcpkg-binary-cache
vcpkg_cache_primary_key: ${{ steps.cache-restore.outputs.vcpkg_cache_primary_key }}
- name: Sanity-check the js repl
shell: bash
run: |
set -e
tar -xvzf Build/distribution/ladybird-js-${{ matrix.package_type }}.tar.gz
./bin/js -c "console.log('Hello, World\!');" > out.txt
if ! grep -q "\"Hello, World\!\"" out.txt; then
echo "Sanity check failed: \"Hello, World\!\" not found in output."
exit 1
fi
- name: Upload js package
uses: actions/upload-artifact@v4
with:
name: ladybird-js-${{ matrix.package_type }}
path: Build/distribution/ladybird-js*.tar.gz
retention-days: 7