mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
146 lines
3.5 KiB
YAML
146 lines
3.5 KiB
YAML
name: zig-test
|
|
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ vars.LPD_PERF_AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.LPD_PERF_AWS_SECRET_ACCESS_KEY }}
|
|
AWS_BUCKET: ${{ vars.LPD_PERF_AWS_BUCKET }}
|
|
AWS_REGION: ${{ vars.LPD_PERF_AWS_REGION }}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "build.zig"
|
|
- "src/**/*.zig"
|
|
- "src/*.zig"
|
|
- "vendor/zig-js-runtime"
|
|
- ".github/**"
|
|
- "vendor/**"
|
|
pull_request:
|
|
|
|
# By default GH trigger on types opened, synchronize and reopened.
|
|
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
|
|
# Since we skip the job when the PR is in draft state, we want to force CI
|
|
# running when the PR is marked ready_for_review w/o other change.
|
|
# see https://github.com/orgs/community/discussions/25722#discussioncomment-3248917
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
|
|
paths:
|
|
- ".github/**"
|
|
- "build.zig"
|
|
- "src/**/*.zig"
|
|
- "src/*.zig"
|
|
- "vendor/**"
|
|
- ".github/**"
|
|
- "vendor/**"
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
zig-build-dev:
|
|
name: zig build dev
|
|
|
|
# Don't run the CI with draft PR.
|
|
if: github.event.pull_request.draft == false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
# fetch submodules recusively, to get zig-js-runtime submodules also.
|
|
submodules: recursive
|
|
|
|
- uses: ./.github/actions/install
|
|
|
|
- name: zig build debug
|
|
run: zig build
|
|
|
|
- name: upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: lightpanda-build-dev
|
|
path: |
|
|
zig-out/bin/lightpanda
|
|
retention-days: 1
|
|
|
|
browser-fetch:
|
|
name: browser fetch
|
|
needs: zig-build-dev
|
|
|
|
# Don't run the CI with draft PR.
|
|
if: github.event.pull_request.draft == false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: lightpanda-build-dev
|
|
|
|
- run: chmod a+x ./lightpanda
|
|
|
|
- run: ./lightpanda fetch https://httpbin.io/xhr/get
|
|
|
|
zig-test:
|
|
name: zig test
|
|
timeout-minutes: 15
|
|
|
|
# Don't run the CI with draft PR.
|
|
if: github.event.pull_request.draft == false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
# fetch submodules recusively, to get zig-js-runtime submodules also.
|
|
submodules: recursive
|
|
|
|
- uses: ./.github/actions/install
|
|
|
|
- name: zig build test
|
|
run: zig build test -- --json > bench.json
|
|
|
|
- name: write commit
|
|
run: |
|
|
echo "${{github.sha}}" > commit.txt
|
|
|
|
- name: upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: bench-results
|
|
path: |
|
|
bench.json
|
|
commit.txt
|
|
retention-days: 10
|
|
|
|
bench-fmt:
|
|
name: perf-fmt
|
|
needs: zig-test
|
|
|
|
# Don't execute on PR
|
|
if: github.event_name != 'pull_request'
|
|
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
container:
|
|
image: ghcr.io/lightpanda-io/perf-fmt:latest
|
|
credentials:
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
|
- name: download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: bench-results
|
|
|
|
- name: format and send json result
|
|
run: /perf-fmt bench-browser ${{ github.sha }} bench.json
|