Skip to content

Commit

Permalink
Add support for Analytics Engine
Browse files Browse the repository at this point in the history
This one was a little tricky to add and requires mocking out the
analytics engine binding using a miniflare wrapped binding that logs
each datapoint to console.

Resolves #280, #327

refactor: rename to match Typescript type names

test: mock out analytics engine binding
  • Loading branch information
cmackenzie1 committed Jan 9, 2025
1 parent 2f401a4 commit 1a8a7d5
Show file tree
Hide file tree
Showing 15 changed files with 1,089 additions and 573 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ jobs:
name: Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
components: clippy, rustfmt
targets: wasm32-unknown-unknown

- name: Check Formatting
run: cargo fmt --all -- --check
Expand All @@ -31,54 +30,41 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
targets: wasm32-unknown-unknown

- name: Check for errors
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check

- name: Run builder tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path worker-build/Cargo.toml
run: cargo test --manifest-path worker-build/Cargo.toml

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: v18.12.1
node-version: 18

- name: Install packages
run: |
sudo apt update
sudo apt clean
sudo apt install -y build-essential libssl-dev netcat libc++-dev
sudo apt install -y build-essential libssl-dev netcat-traditional libc++-dev
- name: Install wasmpack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build local worker-build
uses: actions-rs/cargo@v1
with:
command: install
args: --path ./worker-build --force --debug
run: cargo install --path ./worker-build --force --debug

- name: Install npm dependencies
shell: bash
run: npm ci

- name: Run tests
shell: bash
run: npm run test

- name: Run tests (http)
shell: bash
run: npm run test-http
43 changes: 21 additions & 22 deletions examples/axum/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1a8a7d5

Please sign in to comment.