ci: extract install steps in its own action

This commit is contained in:
Pierre Tachoire
2024-04-16 15:24:16 +02:00
parent e3f487a7f1
commit ffbcfc18f1
3 changed files with 53 additions and 83 deletions

49
.github/actions/install/action.yml vendored Normal file
View File

@@ -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