|
| 1 | +name: end2end |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - "build.zig" |
| 9 | + - "src/**/*.zig" |
| 10 | + - "src/*.zig" |
| 11 | + - "vendor/zig-js-runtime" |
| 12 | + - ".github/**" |
| 13 | + pull_request: |
| 14 | + |
| 15 | + # By default GH trigger on types opened, synchronize and reopened. |
| 16 | + # see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request |
| 17 | + # Since we skip the job when the PR is in draft state, we want to force CI |
| 18 | + # running when the PR is marked ready_for_review w/o other change. |
| 19 | + # see https://github.com/orgs/community/discussions/25722#discussioncomment-3248917 |
| 20 | + types: [opened, synchronize, reopened, ready_for_review] |
| 21 | + |
| 22 | + paths: |
| 23 | + - ".github/**" |
| 24 | + - "build.zig" |
| 25 | + - "src/**/*.zig" |
| 26 | + - "src/*.zig" |
| 27 | + - "vendor/**" |
| 28 | + - ".github/**" |
| 29 | + # Allows you to run this workflow manually from the Actions tab |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +jobs: |
| 33 | + zig-build-release: |
| 34 | + name: zig build release |
| 35 | + |
| 36 | + runs-on: ubuntu-latest |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + fetch-depth: 0 |
| 42 | + # fetch submodules recusively, to get zig-js-runtime submodules also. |
| 43 | + submodules: recursive |
| 44 | + |
| 45 | + - uses: ./.github/actions/install |
| 46 | + |
| 47 | + - name: zig build release |
| 48 | + run: zig build -Doptimize=ReleaseSafe -Dengine=v8 |
| 49 | + |
| 50 | + - name: upload artifact |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: lightpanda-build-release |
| 54 | + path: | |
| 55 | + zig-out/bin/lightpanda |
| 56 | + retention-days: 1 |
| 57 | + |
| 58 | + demo-puppeteer: |
| 59 | + name: demo-puppeteer |
| 60 | + needs: zig-build-release |
| 61 | + |
| 62 | + runs-on: ubuntu-latest |
| 63 | + |
| 64 | + steps: |
| 65 | + - name: download artifact |
| 66 | + uses: actions/download-artifact@v4 |
| 67 | + with: |
| 68 | + name: lightpanda-build-release |
| 69 | + |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + with: |
| 72 | + repository: 'lightpanda-io/demo' |
| 73 | + fetch-depth: 0 |
| 74 | + |
| 75 | + - run: npm install |
| 76 | + - run: | |
| 77 | + go run ws/main.go & |
| 78 | + zig-out/bin/lightpanda & |
| 79 | + npm run bench-puppeteer-cdp |
0 commit comments