mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Meta: Restore the Wasm build CI for LibJS
The new workflow simply publishes the generated objects as artifacts.
This commit is contained in:
parent
aa4360b9a3
commit
1f67bbcca5
1 changed files with 113 additions and 0 deletions
113
.github/workflows/wasm.yml
vendored
Normal file
113
.github/workflows/wasm.yml
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
name: Build Wasm Modules
|
||||
on: [ push, pull_request ]
|
||||
|
||||
env:
|
||||
SERENITY_SOURCE_DIR: ${{ github.workspace }}
|
||||
|
||||
concurrency: wasm
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.repository == 'SerenityOS/serenity'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: "Install Ubuntu dependencies"
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build gcc-12 g++-12 libstdc++-12-dev
|
||||
- name: "Install emscripten"
|
||||
uses: mymindstorm/setup-emsdk@v12
|
||||
with:
|
||||
version: 3.1.25
|
||||
- name: "Check versions"
|
||||
run: |
|
||||
set +e
|
||||
emcc --version
|
||||
ninja --version
|
||||
gcc --version
|
||||
- name: Checkout SerenityOS/libjs-test262-data libjs-wasm
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: SerenityOS/libjs-test262-data
|
||||
path: libjs-test262-data
|
||||
ref: libjs-wasm
|
||||
- name: "Create build directories"
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/Build/caches/TZDB
|
||||
mkdir -p ${{ github.workspace }}/Build/caches/UCD
|
||||
mkdir -p ${{ github.workspace }}/Build/caches/CLDR
|
||||
- name: "TimeZoneData cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ github.workspace }}/Build/caches/TZDB
|
||||
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
|
||||
- name: "UnicodeData cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ github.workspace }}/Build/caches/UCD
|
||||
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
|
||||
- name: "UnicodeLocale cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ github.workspace }}/Build/caches/CLDR
|
||||
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}
|
||||
- name: "Build host lagom tools"
|
||||
run: |
|
||||
cmake -GNinja \
|
||||
-B ${{ github.workspace }}/Build/lagom-tools \
|
||||
-S ${{ github.workspace }}/Meta/Lagom \
|
||||
-DBUILD_LAGOM=OFF \
|
||||
-DSERENITY_CACHE_DIR=${{ github.workspace }}/Build/caches \
|
||||
-DCMAKE_C_COMPILER=gcc-12 \
|
||||
-DCMAKE_CXX_COMPILER=g++-12 \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Build/lagom-tools \
|
||||
-Dpackage=LagomTools
|
||||
|
||||
ninja -C ${{ github.workspace }}/Build/lagom-tools install
|
||||
- name: "Create wasm build environment"
|
||||
run: |
|
||||
emcmake cmake -GNinja \
|
||||
-B ${{ github.workspace }}/Build/wasm \
|
||||
-S ${{ github.workspace }}/Meta/Lagom \
|
||||
-DLagomTools_DIR=${{ github.workspace }}/Build/lagom-tools/share/LagomTools \
|
||||
-DBUILD_LAGOM=ON \
|
||||
-DSERENITY_CACHE_DIR=${{ github.workspace }}/Build/caches \
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
- name: "Build libjs.{js,wasm}"
|
||||
run: |
|
||||
ninja -C ${{ github.workspace }}/Build/wasm libjs.js
|
||||
- name: "Show me what you built :)"
|
||||
run: |
|
||||
ls -l ${{ github.workspace }}/Build/wasm
|
||||
|
||||
- name: "Prepare files"
|
||||
run: |
|
||||
cp ${{ github.workspace }}/Build/wasm/bin/libjs.js ${{ github.workspace }}/libjs-test262-data/libjs.js
|
||||
cp ${{ github.workspace }}/Build/wasm/bin/libjs.wasm ${{ github.workspace }}/libjs-test262-data/libjs.wasm
|
||||
echo 'Module.SERENITYOS_COMMIT = "${{ github.sha }}";' >> ${{ github.workspace }}/libjs-test262-data/libjs.js
|
||||
tar --exclude='.[^/]*' -czvf libjs-wasm.tar.gz -C ${{ github.workspace }}/libjs-test262-data .
|
||||
|
||||
- name: Deploy to GitHub
|
||||
uses: JamesIves/github-pages-deploy-action@v4.4.3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
git-config-name: BuggieBot
|
||||
git-config-email: buggiebot@serenityos.org
|
||||
branch: libjs-wasm
|
||||
repository-name: SerenityOS/libjs-test262-data
|
||||
token: ${{ secrets.BUGGIEBOT_TOKEN }}
|
||||
folder: ${{ github.workspace }}/libjs-test262-data
|
||||
|
||||
- name: Upload artifact package
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: serenity-js-wasm
|
||||
path: libjs-wasm.tar.gz
|
||||
retention-days: 7
|
Loading…
Add table
Reference in a new issue