Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Browsercore install"
description: "Install deps for the project browsercore"

runs:
using: "composite"

steps:
- name: install v8
shell: bash
run: |
mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug/libc_v8.a

mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release/libc_v8.a

- name: install deps
shell: bash
run: |
ln -s /usr/local/lib/libiconv vendor/libiconv

ln -s /usr/local/lib/netsurf/build vendor/netsurf/build
ln -s /usr/local/lib/netsurf/lib vendor/netsurf/lib
ln -s /usr/local/lib/netsurf/include vendor/netsurf/include

# detect file change
- uses: dorny/paths-filter@v3.0.2
id: changes
with:
filters: |
netsurf:
- 'vendor/netsurf/**'

# if a vendor has changed, install build dependencies.
- name: install build dependencies
if: steps.changes.outputs.netsurf == 'true'
shell: bash
run: |
apt update && \
apt install -y git curl bash xz-utils python3 ca-certificates pkg-config \
libglib2.0-dev gperf libexpat1-dev cmake build-essential

# if netsurf has changed, force a rebuild.
- name: re-build netsurf
if: steps.changes.outputs.netsurf == 'true'
shell: bash
run: |
make clean-netsurf
make install-netsurf
28 changes: 10 additions & 18 deletions .github/workflows/wpt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

paths:
- ".github/**"
- "build.zig"
- "src/**/*.zig"
- "src/*.zig"
Expand All @@ -35,6 +36,11 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
pull-requests: read # required for dorny/paths-filter
contents: read
packages: read

jobs:
wpt:
name: web platform tests
Expand All @@ -50,28 +56,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_CI_PAT }}
# fetch submodules recusively, to get jsruntime-lib submodules also.
submodules: recursive

- name: install v8
run: |
mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug/libc_v8.a

mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release/libc_v8.a

- name: install deps
run: |
ln -s /usr/local/lib/libiconv vendor/libiconv

ln -s /usr/local/lib/netsurf/build vendor/netsurf/build
ln -s /usr/local/lib/netsurf/lib vendor/netsurf/lib
ln -s /usr/local/lib/netsurf/include vendor/netsurf/include
- uses: ./.github/actions/install

- run: zig build wpt -Dengine=v8 -- --safe --summary

Expand All @@ -88,7 +80,7 @@ jobs:
echo "${{github.sha}}" > commit.txt

- name: upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wpt-results
path: |
Expand All @@ -112,7 +104,7 @@ jobs:

steps:
- name: download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wpt-results

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/zig-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

paths:
- ".github/**"
- "build.zig"
- "src/**/*.zig"
- "src/*.zig"
Expand All @@ -34,7 +35,7 @@ jobs:
zig_fmt_errs: ${{ steps.fmt.outputs.zig_fmt_errs }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
64 changes: 14 additions & 50 deletions .github/workflows/zig-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

paths:
- ".github/**"
- "build.zig"
- "src/**/*.zig"
- "src/*.zig"
- "vendor/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
pull-requests: read # required for dorny/paths-filter
contents: read
packages: read

jobs:
zig-build-dev:
name: zig build dev
Expand All @@ -48,28 +54,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_CI_PAT }}
# fetch submodules recusively, to get jsruntime-lib submodules also.
submodules: recursive

- name: install v8
run: |
mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug/libc_v8.a

mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release/libc_v8.a

- name: install deps
run: |
ln -s /usr/local/lib/libiconv vendor/libiconv

ln -s /usr/local/lib/netsurf/build vendor/netsurf/build
ln -s /usr/local/lib/netsurf/lib vendor/netsurf/lib
ln -s /usr/local/lib/netsurf/include vendor/netsurf/include
- uses: ./.github/actions/install

- name: zig build debug
run: zig build -Dengine=v8
Expand All @@ -88,28 +80,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_CI_PAT }}
# fetch submodules recusively, to get jsruntime-lib submodules also.
submodules: recursive

- name: install v8
run: |
mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug/libc_v8.a

mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release/libc_v8.a

- name: install deps
run: |
ln -s /usr/local/lib/libiconv vendor/libiconv

ln -s /usr/local/lib/netsurf/build vendor/netsurf/build
ln -s /usr/local/lib/netsurf/lib vendor/netsurf/lib
ln -s /usr/local/lib/netsurf/include vendor/netsurf/include
- uses: ./.github/actions/install

- name: zig build release
run: zig build -Doptimize=ReleaseSafe -Dengine=v8
Expand All @@ -128,28 +106,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_CI_PAT }}
# fetch submodules recusively, to get jsruntime-lib submodules also.
submodules: recursive

- name: install v8
run: |
mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/debug/libc_v8.a

mkdir -p vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release
ln -s /usr/local/lib/libc_v8.a vendor/jsruntime-lib/vendor/v8/${{env.ARCH}}/release/libc_v8.a

- name: install deps
run: |
ln -s /usr/local/lib/libiconv vendor/libiconv

ln -s /usr/local/lib/netsurf/build vendor/netsurf/build
ln -s /usr/local/lib/netsurf/lib vendor/netsurf/lib
ln -s /usr/local/lib/netsurf/include vendor/netsurf/include
- uses: ./.github/actions/install

- name: zig build test
run: zig build test -Dengine=v8 -- --json > bench.json
Expand All @@ -159,7 +123,7 @@ jobs:
echo "${{github.sha}}" > commit.txt

- name: upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bench-results
path: |
Expand All @@ -183,7 +147,7 @@ jobs:

steps:
- name: download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bench-results

Expand Down