Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use edgee-component toml to build #3

Merged
merged 7 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: Check
on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
test:
name: test
runs-on: ubuntu-latest
container:
image: ghcr.io/webassembly/wasi-sdk:latest
test:
name: test
runs-on: ubuntu-latest
container:
image: ghcr.io/webassembly/wasi-sdk:latest

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

- name: "Set up C component build system"
run: |
apt-get update
apt install curl clang build-essential -y
- name: "Set up C component build system"
run: |
apt-get update
apt install curl clang build-essential -y

- name: Set up minimal stable Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Set up minimal stable Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Install wasm tooling
run: CC=clang cargo install wit-bindgen-cli wasm-tools --locked
- name: Install wasm tooling
run: CC=clang cargo install wit-bindgen-cli wasm-tools --locked

- name: Build component
run: |
make setup
make build
- name: Build component
run: |
make setup
make build-no-edgee
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ internal:
cd internal && wit-bindgen c ../wit && cd ..
setup: internal ## setup development environment

build: setup ## build component
build:
edgee components build

build-no-edgee: setup ## build component
$(CC) dc_component.c internal/data_collection.c internal/data_collection_component_type.o -o /dev/stdout -mexec-model=reactor -Os | wasm-tools component new -o dc_component.wasm

clean: ## clean build artifacts
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Requirements:
- [WASI SDK](https://github.com/webassembly/wasi-sdk)
- [wasm-tools](https://github.com/bytecodealliance/wasm-tools)
- [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen#cli-installation)
- [edgee-cli] (https://github.com/edgee-cloud/edgee)

```shell
$ make setup
Expand Down
15 changes: 15 additions & 0 deletions edgee-component.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
manifest_version = 1

[package]
name = "example-c-component"
version = "1.0.0"
category = "data-collection"
subcategory = "analytics"
description = "Example C component for data collection"
documentation = "https://github.com/edgee-cloud/example-c-component"
repository = "https://github.com/edgee-cloud/example-c-component"
wit-world-version = "0.4.0"

[package.build]
command = "$(CC) dc_component.c internal/data_collection.c internal/data_collection_component_type.o -o /dev/stdout -mexec-model=reactor -Os | wasm-tools component new -o dc_component.wasm"
output_path = "./dc_component.wasm"