Skip to content

Commit

Permalink
update prettier and esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jan 27, 2025
1 parent 52568fe commit 0b8f87f
Show file tree
Hide file tree
Showing 19 changed files with 707 additions and 175 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/_bazel.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: "Run Bazel"
name: 'Run Bazel'
on:
workflow_call:
inputs:
image:
type: string
required: false
default: "ubuntu-22.04"
default: 'ubuntu-22.04'
os_name:
type: string
required: false
default: "linux"
default: 'linux'
suffix:
type: string
required: false
default: ""
default: ''
run_tests:
type: boolean
required: false
default: true
extra_bazel_args:
type: string
required: false
default: ""
default: ''
secrets:
BAZEL_CACHE_KEY:
required: true
Expand Down Expand Up @@ -83,11 +83,11 @@ jobs:
# timestamps are no longer being added here, the GitHub logs include timestamps (Use
# 'Show timestamps' on the web interface)
run: |
bazel build --config=ci --config=ci-${{ inputs.os_name }}${{ inputs.suffix }} --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev ${{ inputs.extra_bazel_args }} //...
bazel build ${{ inputs.extra_bazel_args }} --config=ci --config=ci-${{ inputs.os_name }}${{ inputs.suffix }} --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev //...
- name: Bazel test
if: inputs.run_tests
run: |
bazel test --config=ci --config=ci-${{ inputs.os_name }}${{ inputs.suffix }} --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev ${{ inputs.extra_bazel_args }} //...
bazel test ${{ inputs.extra_bazel_args }} --config=ci --config=ci-${{ inputs.os_name }}${{ inputs.suffix }} --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev //...
- name: Report disk usage (in MB)
if: always()
shell: bash
Expand All @@ -100,6 +100,14 @@ jobs:
du -ms -t 1 $BAZEL_OUTPUT_BASE
echo "Workspace usage statistics"
du -ms -t 1 $GITHUB_WORKSPACE
- name: Upload binary
if: inputs.os_name == 'linux-arm' && inputs.suffix == ''
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.os_name }}-${{ runner.arch }}${{ inputs.suffix }}-binary
path: bazel-bin/src/workerd/server/workerd

- name: Drop large Bazel cache files
if: always()
# Github has a nominal 10GB of storage for all cached builds associated with a project.
Expand All @@ -116,6 +124,7 @@ jobs:
else
echo "Disk cache does not exist: ~/bazel-disk-cache"
fi
- name: Bazel shutdown
# Check that there are no .bazelrc issues that prevent shutdown.
run: bazel shutdown
68 changes: 52 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ name: Tests
on:
pull_request:
paths-ignore:
- 'doc/**'
- 'doc/**'
merge_group:
push:
branches:
- main
- main

concurrency:
# Cancel existing builds for the same PR.
# Otherwise, all other builds will be allowed to run through.
group: test.yml-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true


jobs:
fixup:
if: github.event_name == 'pull_request'
Expand All @@ -28,21 +27,20 @@ jobs:
matrix:
os:
[
{ name : linux, image : ubuntu-22.04 },
{ name : linux-arm, image : ubuntu-22.04-arm },
{ name : macOS, image : macos-15 },
{ name : windows, image : windows-2025 }
{ name: linux, image: ubuntu-22.04 },
{ name: linux-arm, image: ubuntu-22.04-arm },
{ name: macOS, image: macos-15 },
{ name: windows, image: windows-2025 },
]
config:
[
config: [
# Default build: no suffix or additional bazel arguments
{ suffix: '' },
# Debug build
{ suffix: -debug }
{ suffix: -debug },
]
include:
# Add an Address Sanitizer (ASAN) build on Linux for additional checking.
- os: { name: linux, image: ubuntu-22.04 }
- os: { name: linux, image: ubuntu-22.04 }
config: { suffix: -asan }
# TODO (later): The custom Windows-debug configuration consistently runs out of disk
# space on CI, disable it for now. Once https://github.com/bazelbuild/bazel/issues/21615
Expand All @@ -51,30 +49,68 @@ jobs:
# - os: { name : windows, image : windows-2025 }
# config: { suffix: -debug, bazel-args: --config=windows_dbg }
exclude:
- os: { name : windows, image : windows-2025 }
- os: { name: windows, image: windows-2025 }
config: { suffix: -debug }
# due to resource constraints, exclude the macOS and x64 Linux debug runners for now.
# linux-asan and arm64 linux-debug should provide sufficient coverage for building in the
# debug configuration.
- os: { name : macOS, image : macos-15 }
- os: { name: macOS, image: macos-15 }
config: { suffix: -debug }
- os: { name : linux, image : ubuntu-22.04 }
- os: { name: linux, image: ubuntu-22.04 }
config: { suffix: -debug }
fail-fast: false
uses: ./.github/workflows/_bazel.yml
with:
image: ${{ matrix.os.image }}
os_name: ${{ matrix.os.name }}
suffix: ${{ matrix.config.suffix }}
extra_bazel_args: "--config=ci-test"
extra_bazel_args: '--config=ci-test'
secrets:
BAZEL_CACHE_KEY: ${{ secrets.BAZEL_CACHE_KEY }}
WORKERS_MIRROR_URL: ${{ secrets.WORKERS_MIRROR_URL }}
lint:
uses: ./.github/workflows/_bazel.yml
with:
extra_bazel_args: "--config=lint --config=ci-test"
extra_bazel_args: '--config=lint --config=ci-test'
run_tests: false
secrets:
BAZEL_CACHE_KEY: ${{ secrets.BAZEL_CACHE_KEY }}
WORKERS_MIRROR_URL: ${{ secrets.WORKERS_MIRROR_URL }}

workers-sdk-test:
needs: test
name: Run workers-sdk tests
runs-on: ubuntu-22.04-arm
steps:
- name: Checkout workers-sdk
uses: actions/checkout@v4
with:
repository: cloudflare/workers-sdk

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
# Match workers-sdk node version
node-version: 18.20.5
cache: 'pnpm'
- name: Install workers-sdk dependencies
run: pnpm install

- name: Download workerd binary
uses: actions/download-artifact@v4
with:
name: linux-arm-ARM64-binary
path: /tmp

- name: Make workerd binary executable
run: chmod +x /tmp/workerd

- name: Build Wrangler + Miniflare & dependencies
run: pnpm build --filter miniflare --filter wrangler

- name: Run Miniflare tests
run: pnpm test:ci --concurrency 1 --filter miniflare --filter wrangler
env:
MINIFLARE_WORKERD_PATH: /tmp/workerd
2 changes: 1 addition & 1 deletion build/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ build:ci-linux-common --action_env=CC=/usr/lib/llvm-16/bin/clang --action_env=CX
build:ci-linux-common --host_action_env=CC=/usr/lib/llvm-16/bin/clang --host_action_env=CXX=/usr/lib/llvm-16/bin/clang++

build:ci-linux --config=ci-linux-common
build:ci-linux-arm --config=ci-linux
build:ci-linux-arm --config=ci-linux --remote_download_regex=".*src/workerd/server/workerd.*"

build:ci-linux-debug --config=ci-linux-common --config=ci-limit-storage
build:ci-linux-debug --config=debug --config=rust-debug
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
},
"dependencies": {
"capnp-ts": "^0.7.0",
"prettier": "^3.3.3",
"prettier": "^3.3.4",
"typescript": "5.5.4"
},
"devDependencies": {
"@bazel/bazelisk": "~1.21.0",
"@eslint/js": "^9.10.0",
"@types/debug": "^4.1.12",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.16.5",
"capnpc-ts": "^0.7.0",
"chrome-remote-interface": "^0.33.2",
"esbuild": "^0.21.5",
"esbuild": "^0.24.2",
"eslint": "^9.10.0",
"eslint-plugin-import": "^2.30.0",
"expect-type": "^0.20.0",
Expand Down
Loading

0 comments on commit 0b8f87f

Please sign in to comment.