Skip to content

Commit 9ad6e70

Browse files
Merge pull request #241 from lightpanda-io/ci
ci: remove container usage
2 parents e7fd4b1 + 512c5a9 commit 9ad6e70

File tree

4 files changed

+78
-79
lines changed

4 files changed

+78
-79
lines changed

.github/actions/install/action.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "V8 install"
2+
description: "Install deps for the project"
3+
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+
30+
runs:
31+
using: "composite"
32+
33+
steps:
34+
- uses: mlugg/setup-zig@v1
35+
with:
36+
version: ${{ inputs.zig }}
37+
38+
- name: Cache v8
39+
id: cache-v8
40+
uses: actions/cache@v3
41+
env:
42+
cache-name: cache-v8
43+
with:
44+
path: ${{ inputs.cache-dir }}/v8
45+
key: libc_v8_${{ inputs.v8 }}_${{ inputs.os }}_${{ inputs.arch }}.a
46+
47+
- if: ${{ steps.cache-v8.outputs.cache-hit != 'true' }}
48+
shell: bash
49+
run: |
50+
mkdir -p ${{ inputs.cache-dir }}/v8
51+
52+
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
53+
54+
- name: install v8
55+
shell: bash
56+
run: |
57+
mkdir -p vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug
58+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug/libc_v8.a
59+
60+
mkdir -p vendor/v8/${{inputs.arch}}-${{inputs.os}}/release
61+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/v8/${{inputs.arch}}-${{inputs.os}}/release/libc_v8.a

.github/workflows/benchmark.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: benchmark
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 }}
@@ -35,35 +34,18 @@ jobs:
3534
benchmark:
3635
name: benchmark
3736

38-
# Don't run the CI with draft PR.
39-
if: github.event.pull_request.draft == false
40-
4137
runs-on: ubuntu-latest
42-
container:
43-
image: ghcr.io/lightpanda-io/zig-v8:0.12.1
44-
credentials:
45-
username: ${{ github.actor }}
46-
password: ${{ secrets.GITHUB_TOKEN }}
4738

48-
# docker blocks io_uring syscalls by default now.
49-
# see https://github.com/tigerbeetle/tigerbeetle/pull/1995
50-
# see https://github.com/moby/moby/pull/46762
51-
options: "--security-opt seccomp=unconfined"
39+
# Don't run the CI with draft PR.
40+
if: github.event.pull_request.draft == false
5241

5342
steps:
54-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
5544
with:
5645
fetch-depth: 0
57-
token: ${{ secrets.GH_CI_PAT }}
5846
submodules: true
5947

60-
- name: install v8
61-
run: |
62-
mkdir -p vendor/v8/${{env.ARCH}}/debug
63-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/debug/libc_v8.a
64-
65-
mkdir -p vendor/v8/${{env.ARCH}}/release
66-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/release/libc_v8.a
48+
- uses: ./.github/actions/install
6749

6850
- run: zig build -Doptimize=ReleaseSafe -Dengine=v8
6951
- name: run benchmark

.github/workflows/zig-fmt.yml

Lines changed: 8 additions & 8 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

@@ -27,16 +30,13 @@ jobs:
2730
if: github.event.pull_request.draft == false
2831

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

3834
steps:
39-
- uses: actions/checkout@v3
35+
- uses: mlugg/setup-zig@v1
36+
with:
37+
version: ${{ env.ZIG_VERSION }}
38+
39+
- uses: actions/checkout@v4
4040
with:
4141
fetch-depth: 0
4242

.github/workflows/zig-test.yml

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

3-
env:
4-
ARCH: x86_64-linux
5-
63
on:
74
push:
85
branches:
@@ -39,26 +36,14 @@ jobs:
3936
if: github.event.pull_request.draft == false
4037

4138
runs-on: ubuntu-latest
42-
container:
43-
image: ghcr.io/lightpanda-io/zig-v8:0.12.1
44-
credentials:
45-
username: ${{ github.actor }}
46-
password: ${{ secrets.GITHUB_TOKEN }}
4739

4840
steps:
49-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
5042
with:
5143
fetch-depth: 0
52-
token: ${{ secrets.GH_CI_PAT }}
5344
submodules: true
5445

55-
- name: install v8
56-
run: |
57-
mkdir -p vendor/v8/${{env.ARCH}}/debug
58-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/debug/libc_v8.a
59-
60-
mkdir -p vendor/v8/${{env.ARCH}}/release
61-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/release/libc_v8.a
46+
- uses: ./.github/actions/install
6247

6348
- name: zig build debug
6449
run: zig build -Dengine=v8
@@ -70,26 +55,14 @@ jobs:
7055
if: github.event.pull_request.draft == false
7156

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

7959
steps:
8060
- uses: actions/checkout@v3
8161
with:
8262
fetch-depth: 0
83-
token: ${{ secrets.GH_CI_PAT }}
8463
submodules: true
8564

86-
- name: install v8
87-
run: |
88-
mkdir -p vendor/v8/${{env.ARCH}}/debug
89-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/debug/libc_v8.a
90-
91-
mkdir -p vendor/v8/${{env.ARCH}}/release
92-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/release/libc_v8.a
65+
- uses: ./.github/actions/install
9366

9467
- name: zig build release
9568
run: zig build -Doptimize=ReleaseSafe -Dengine=v8
@@ -101,31 +74,14 @@ jobs:
10174
if: github.event.pull_request.draft == false
10275

10376
runs-on: ubuntu-latest
104-
container:
105-
image: ghcr.io/lightpanda-io/zig-v8:0.12.1
106-
credentials:
107-
username: ${{ github.actor }}
108-
password: ${{ secrets.GITHUB_TOKEN }}
109-
110-
# docker blocks io_uring syscalls by default now.
111-
# see https://github.com/tigerbeetle/tigerbeetle/pull/1995
112-
# see https://github.com/moby/moby/pull/46762
113-
options: "--security-opt seccomp=unconfined"
11477

11578
steps:
116-
- uses: actions/checkout@v3
79+
- uses: actions/checkout@v4
11780
with:
11881
fetch-depth: 0
119-
token: ${{ secrets.GH_CI_PAT }}
12082
submodules: true
12183

122-
- name: install v8
123-
run: |
124-
mkdir -p vendor/v8/${{env.ARCH}}/debug
125-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/debug/libc_v8.a
126-
127-
mkdir -p vendor/v8/${{env.ARCH}}/release
128-
ln -s /usr/local/lib/libc_v8.a vendor/v8/${{env.ARCH}}/release/libc_v8.a
84+
- uses: ./.github/actions/install
12985

13086
- name: zig build test
13187
run: zig build test -Dengine=v8

0 commit comments

Comments
 (0)