diff --git a/.github/workflows/e2e-integration-test.yml b/.github/workflows/e2e-integration-test.yml index dff1fb59..da4056ca 100644 --- a/.github/workflows/e2e-integration-test.yml +++ b/.github/workflows/e2e-integration-test.yml @@ -23,8 +23,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4b31e193..a8e36ca5 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -9,15 +9,13 @@ env: on: push: - branches: - - main + branches: [main] paths: - - "build.zig" - - "src/**/*.zig" - - "src/*.zig" - - "vendor/zig-js-runtime" - ".github/**" - - "vendor/**" + - "src/**" + - "build.zig" + - "build.zig.zon" + pull_request: # By default GH trigger on types opened, synchronize and reopened. @@ -29,12 +27,10 @@ on: paths: - ".github/**" + - "src/**" - "build.zig" - - "src/**/*.zig" - - "src/*.zig" - - "vendor/**" - - ".github/**" - - "vendor/**" + - "build.zig.zon" + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -52,8 +48,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install @@ -182,9 +176,6 @@ jobs: name: wba-test needs: zig-build-release - env: - LIGHTPANDA_DISABLE_TELEMETRY: true - runs-on: ubuntu-latest timeout-minutes: 5 @@ -227,7 +218,6 @@ jobs: MAX_VmHWM: 28000 # 28MB (KB) MAX_CG_PEAK: 8000 # 8MB (KB) MAX_AVG_DURATION: 17 - LIGHTPANDA_DISABLE_TELEMETRY: true # How to give cgroups access to the user actions-runner on the host: # $ sudo apt install cgroup-tools @@ -359,8 +349,8 @@ jobs: container: image: ghcr.io/lightpanda-io/perf-fmt:latest credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} steps: - name: download artifact diff --git a/.github/workflows/build.yml b/.github/workflows/nightly.yml similarity index 93% rename from .github/workflows/build.yml rename to .github/workflows/nightly.yml index 7562c38f..1c1ece06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/nightly.yml @@ -5,6 +5,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.NIGHTLY_BUILD_AWS_SECRET_ACCESS_KEY }} AWS_BUCKET: ${{ vars.NIGHTLY_BUILD_AWS_BUCKET }} AWS_REGION: ${{ vars.NIGHTLY_BUILD_AWS_REGION }} + RELEASE: ${{ github.ref_type == 'tag' && github.ref_name || 'nightly' }} GIT_VERSION_FLAG: ${{ github.ref_type == 'tag' && format('-Dgit_version={0}', github.ref_name) || '' }} @@ -34,8 +35,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install with: @@ -76,8 +75,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install with: @@ -120,8 +117,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install with: @@ -162,8 +157,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install with: diff --git a/.github/workflows/wpt.yml b/.github/workflows/wpt.yml index ef887612..5b6f9f9f 100644 --- a/.github/workflows/wpt.yml +++ b/.github/workflows/wpt.yml @@ -26,8 +26,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install diff --git a/.github/workflows/zig-fmt.yml b/.github/workflows/zig-fmt.yml deleted file mode 100644 index a6df7e1f..00000000 --- a/.github/workflows/zig-fmt.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: zig-fmt - -on: - 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" - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - zig-fmt: - name: zig fmt - - # Don't run the CI with draft PR. - if: github.event.pull_request.draft == false - - runs-on: ubuntu-latest - timeout-minutes: 15 - - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - # Zig version used from the `minimum_zig_version` field in build.zig.zon - - uses: mlugg/setup-zig@v2 - - - name: Run zig fmt - id: fmt - run: | - zig fmt --check ./*.zig ./**/*.zig 2> zig-fmt.err > zig-fmt.err2 || echo "Failed" - delimiter="$(openssl rand -hex 8)" - echo "zig_fmt_errs<<${delimiter}" >> "${GITHUB_OUTPUT}" - - if [ -s zig-fmt.err ]; then - echo "// The following errors occurred:" >> "${GITHUB_OUTPUT}" - cat zig-fmt.err >> "${GITHUB_OUTPUT}" - fi - - if [ -s zig-fmt.err2 ]; then - echo "// The following files were not formatted:" >> "${GITHUB_OUTPUT}" - cat zig-fmt.err2 >> "${GITHUB_OUTPUT}" - fi - - echo "${delimiter}" >> "${GITHUB_OUTPUT}" - - - name: Fail the job - if: steps.fmt.outputs.zig_fmt_errs != '' - run: exit 1 diff --git a/.github/workflows/zig-test.yml b/.github/workflows/zig-test.yml index ca967c3a..a96ec0bf 100644 --- a/.github/workflows/zig-test.yml +++ b/.github/workflows/zig-test.yml @@ -5,19 +5,18 @@ env: 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 }} + LIGHTPANDA_DISABLE_TELEMETRY: true on: push: - branches: - - main + branches: [main] paths: - - "build.zig" - - "src/**" - - "vendor/zig-js-runtime" - ".github/**" - - "vendor/**" - pull_request: + - "src/**" + - "build.zig" + - "build.zig.zon" + 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 @@ -27,28 +26,63 @@ on: paths: - ".github/**" + - "src/**" - "build.zig" - - "src/**/*.zig" - - "src/*.zig" - - "vendor/**" - - ".github/**" - - "vendor/**" + - "build.zig.zon" + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: - zig-test-debug: - name: zig test using v8 in debug mode - timeout-minutes: 15 + zig-fmt: + name: zig fmt runs-on: ubuntu-latest + timeout-minutes: 15 + + if: github.event.pull_request.draft == false + + steps: + - uses: actions/checkout@v6 + + # Zig version used from the `minimum_zig_version` field in build.zig.zon + - uses: mlugg/setup-zig@v2 + + - name: Run zig fmt + id: fmt + run: | + zig fmt --check ./*.zig ./**/*.zig 2> zig-fmt.err > zig-fmt.err2 || echo "Failed" + delimiter="$(openssl rand -hex 8)" + echo "zig_fmt_errs<<${delimiter}" >> "${GITHUB_OUTPUT}" + + if [ -s zig-fmt.err ]; then + echo "// The following errors occurred:" >> "${GITHUB_OUTPUT}" + cat zig-fmt.err >> "${GITHUB_OUTPUT}" + fi + + if [ -s zig-fmt.err2 ]; then + echo "// The following files were not formatted:" >> "${GITHUB_OUTPUT}" + cat zig-fmt.err2 >> "${GITHUB_OUTPUT}" + fi + + echo "${delimiter}" >> "${GITHUB_OUTPUT}" + + - name: Fail the job + if: steps.fmt.outputs.zig_fmt_errs != '' + run: exit 1 + + zig-test-debug: + name: zig test using v8 in debug mode + + runs-on: ubuntu-latest + timeout-minutes: 15 + + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install with: @@ -57,21 +91,18 @@ jobs: - name: zig build test run: zig build -Dprebuilt_v8_path=v8/libc_v8_debug.a -Dtsan=true test - zig-test: + zig-test-release: 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 + timeout-minutes: 15 + + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - # fetch submodules recusively, to get zig-js-runtime submodules also. - submodules: recursive - uses: ./.github/actions/install @@ -93,19 +124,18 @@ jobs: bench-fmt: name: perf-fmt - needs: zig-test - - # Don't execute on PR - if: github.event_name != 'pull_request' + needs: zig-test-release runs-on: ubuntu-latest timeout-minutes: 15 + if: github.event_name != 'pull_request' + container: image: ghcr.io/lightpanda-io/perf-fmt:latest credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} steps: - name: download artifact