Skip to content

Commit f793278

Browse files
Merge pull request #255 from lightpanda-io/ci
ci: remove container usage and download v8 from release
2 parents 5fb25cf + cdbbc71 commit f793278

File tree

5 files changed

+104
-68
lines changed

5 files changed

+104
-68
lines changed

.github/actions/install/action.yml

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,73 @@
11
name: "Browsercore install"
22
description: "Install deps for the project browsercore"
33

4+
inputs:
5+
zig:
6+
description: 'Zig version to install'
7+
required: false
8+
default: '0.12.1'
9+
arch:
10+
description: 'CPU arch used to select the v8 lib'
11+
required: false
12+
default: 'x86_64'
13+
os:
14+
description: 'OS used to select the v8 lib'
15+
required: false
16+
default: 'linux'
17+
zig-v8:
18+
description: 'zig v8 version to install'
19+
required: false
20+
default: 'v0.1.5'
21+
v8:
22+
description: 'v8 version to install'
23+
required: false
24+
default: '11.1.134'
25+
cache-dir:
26+
description: 'cache dir to use'
27+
required: false
28+
default: '~/.cache'
29+
430
runs:
531
using: "composite"
632

733
steps:
34+
- name: Install apt deps
35+
if: ${{ inputs.os == 'linux' }}
36+
shell: bash
37+
run: sudo apt-get install -y wget xz-utils python3 ca-certificates git pkg-config libglib2.0-dev gperf libexpat1-dev cmake clang
38+
39+
- uses: mlugg/setup-zig@v1
40+
with:
41+
version: ${{ inputs.zig }}
42+
43+
- name: Cache v8
44+
id: cache-v8
45+
uses: actions/cache@v3
46+
env:
47+
cache-name: cache-v8
48+
with:
49+
path: ${{ inputs.cache-dir }}/v8
50+
key: libc_v8_${{ inputs.v8 }}_${{ inputs.os }}_${{ inputs.arch }}.a
51+
52+
- if: ${{ steps.cache-v8.outputs.cache-hit != 'true' }}
53+
shell: bash
54+
run: |
55+
mkdir -p ${{ inputs.cache-dir }}/v8
56+
57+
wget -O ${{ inputs.cache-dir }}/v8/libc_v8.a https://github.com/lightpanda-io/zig-v8-fork/releases/download/${{ inputs.zig-v8 }}/libc_v8_${{ inputs.v8 }}_${{ inputs.os }}_${{ inputs.arch }}.a
58+
859
- name: install v8
960
shell: bash
1061
run: |
11-
mkdir -p vendor/zig-js-runtime/vendor/v8/${{env.ARCH}}/debug
12-
ln -s /usr/local/lib/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{env.ARCH}}/debug/libc_v8.a
62+
mkdir -p vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug
63+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug/libc_v8.a
1364
14-
mkdir -p vendor/zig-js-runtime/vendor/v8/${{env.ARCH}}/release
15-
ln -s /usr/local/lib/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{env.ARCH}}/release/libc_v8.a
65+
mkdir -p vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/release
66+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/release/libc_v8.a
1667
1768
- name: libiconv
1869
shell: bash
19-
run: |
20-
ln -s /usr/local/lib/libiconv vendor/libiconv
70+
run: make install-libiconv
2171

2272
- name: build mimalloc
2373
shell: bash

.github/workflows/build.yml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: nightly build
22

3-
env:
4-
ARCH: x86_64-linux
5-
63
on:
74
schedule:
85
- cron: "2 2 * * *"
@@ -12,26 +9,44 @@ on:
129

1310
permissions:
1411
contents: write
15-
packages: read
1612

1713
jobs:
18-
build:
19-
name: nightly build
20-
21-
strategy:
22-
matrix:
23-
target:
24-
- x86_64-linux
25-
include:
26-
- target: x86_64-linux
27-
os: ubuntu-latest
28-
29-
runs-on: ${{ matrix.os }}
30-
container:
31-
image: ghcr.io/lightpanda-io/zig-browsercore:0.12.1
32-
credentials:
33-
username: ${{ github.actor }}
34-
password: ${{ secrets.GITHUB_TOKEN }}
14+
build-linux-x86_64:
15+
env:
16+
ARCH: x86_64
17+
OS: linux
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
token: ${{ secrets.GH_CI_PAT }}
26+
# fetch submodules recusively, to get zig-js-runtime submodules also.
27+
submodules: recursive
28+
29+
- uses: ./.github/actions/install
30+
31+
- name: zig build
32+
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8
33+
34+
- name: Rename binary
35+
run: mv zig-out/bin/browsercore-get lightpanda-get-${{ env.ARCH }}-${{ env.OS }}
36+
37+
- name: Upload the build
38+
uses: ncipollo/release-action@v1
39+
with:
40+
allowUpdates: true
41+
artifacts: lightpanda-get-${{ env.ARCH }}-${{ env.OS }}
42+
tag: nightly
43+
44+
build-macos-aarch64:
45+
env:
46+
ARCH: aarch64
47+
OS: macos
48+
49+
runs-on: macos-latest
3550

3651
steps:
3752
- uses: actions/checkout@v4
@@ -42,16 +57,19 @@ jobs:
4257
submodules: recursive
4358

4459
- uses: ./.github/actions/install
60+
with:
61+
os: ${{env.OS}}
62+
arch: ${{env.ARCH}}
4563

4664
- name: zig build
4765
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8
4866

4967
- name: Rename binary
50-
run: mv zig-out/bin/browsercore-get lightpanda-get-${{ matrix.target }}
68+
run: mv zig-out/bin/browsercore-get lightpanda-get-${{ env.ARCH }}-${{ env.OS }}
5169

5270
- name: Upload the build
5371
uses: ncipollo/release-action@v1
5472
with:
5573
allowUpdates: true
56-
artifacts: lightpanda-get-${{ matrix.target }}
74+
artifacts: lightpanda-get-${{ env.ARCH }}-${{ env.OS }}
5775
tag: nightly

.github/workflows/wpt.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: wpt
22

33
env:
4-
ARCH: x86_64-linux
54
AWS_ACCESS_KEY_ID: ${{ vars.LPD_PERF_AWS_ACCESS_KEY_ID }}
65
AWS_SECRET_ACCESS_KEY: ${{ secrets.LPD_PERF_AWS_SECRET_ACCESS_KEY }}
76
AWS_BUCKET: ${{ vars.LPD_PERF_AWS_BUCKET }}
@@ -46,16 +45,6 @@ jobs:
4645
if: github.event.pull_request.draft == false
4746

4847
runs-on: ubuntu-latest
49-
container:
50-
image: ghcr.io/lightpanda-io/zig-browsercore:0.12.1
51-
credentials:
52-
username: ${{ github.actor }}
53-
password: ${{ secrets.GITHUB_TOKEN }}
54-
55-
# docker blocks io_uring syscalls by default now.
56-
# see https://github.com/tigerbeetle/tigerbeetle/pull/1995
57-
# see https://github.com/moby/moby/pull/46762
58-
options: "--security-opt seccomp=unconfined"
5948

6049
steps:
6150
- uses: actions/checkout@v4

.github/workflows/zig-fmt.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: zig-fmt
22

3+
env:
4+
ZIG_VERSION: 0.12.1
5+
36
on:
47
pull_request:
58

@@ -26,15 +29,12 @@ jobs:
2629
if: github.event.pull_request.draft == false
2730

2831
runs-on: ubuntu-latest
29-
container:
30-
image: ghcr.io/lightpanda-io/zig:0.12.1
31-
credentials:
32-
username: ${{ github.actor }}
33-
password: ${{ secrets.GITHUB_TOKEN }}
34-
outputs:
35-
zig_fmt_errs: ${{ steps.fmt.outputs.zig_fmt_errs }}
3632

3733
steps:
34+
- uses: mlugg/setup-zig@v1
35+
with:
36+
version: ${{ env.ZIG_VERSION }}
37+
3838
- uses: actions/checkout@v4
3939
with:
4040
fetch-depth: 0

.github/workflows/zig-test.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: zig-test
22

33
env:
4-
ARCH: x86_64-linux
54
AWS_ACCESS_KEY_ID: ${{ vars.LPD_PERF_AWS_ACCESS_KEY_ID }}
65
AWS_SECRET_ACCESS_KEY: ${{ secrets.LPD_PERF_AWS_SECRET_ACCESS_KEY }}
76
AWS_BUCKET: ${{ vars.LPD_PERF_AWS_BUCKET }}
@@ -44,11 +43,6 @@ jobs:
4443
if: github.event.pull_request.draft == false
4544

4645
runs-on: ubuntu-latest
47-
container:
48-
image: ghcr.io/lightpanda-io/zig-browsercore:0.12.1
49-
credentials:
50-
username: ${{ github.actor }}
51-
password: ${{ secrets.GITHUB_TOKEN }}
5246

5347
steps:
5448
- uses: actions/checkout@v4
@@ -70,11 +64,6 @@ jobs:
7064
if: github.event_name != 'pull_request'
7165

7266
runs-on: ubuntu-latest
73-
container:
74-
image: ghcr.io/lightpanda-io/zig-browsercore:0.12.1
75-
credentials:
76-
username: ${{ github.actor }}
77-
password: ${{ secrets.GITHUB_TOKEN }}
7867

7968
steps:
8069
- uses: actions/checkout@v4
@@ -96,16 +85,6 @@ jobs:
9685
if: github.event.pull_request.draft == false
9786

9887
runs-on: ubuntu-latest
99-
container:
100-
image: ghcr.io/lightpanda-io/zig-browsercore:0.12.1
101-
credentials:
102-
username: ${{ github.actor }}
103-
password: ${{ secrets.GITHUB_TOKEN }}
104-
105-
# docker blocks io_uring syscalls by default now.
106-
# see https://github.com/tigerbeetle/tigerbeetle/pull/1995
107-
# see https://github.com/moby/moby/pull/46762
108-
options: "--security-opt seccomp=unconfined"
10988

11089
steps:
11190
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)