Skip to content

Commit 65beea9

Browse files
committed
ci(*): add build.yml and address some npm test errors
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 8ce8ac1 commit 65beea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+67
-125
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
branches: [main]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
17+
- name: Setup Spin
18+
uses: fermyon/actions/spin/setup@v1
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Install bart
23+
run: |
24+
curl -LOs https://github.com/fermyon/bartholomew/releases/download/v0.10.0/bart
25+
chmod +x bart
26+
mv bart /usr/local/bin
27+
28+
- name: Check Docs
29+
run: |
30+
bart check --shortcodes shortcodes content/* && bart check --shortcodes shortcodes content/**/*
31+
32+
- name: Install npm packages
33+
run: |
34+
npm ci
35+
npm ci --prefix ./spin-up-hub
36+
37+
- name: Build app
38+
run: |
39+
spin build
40+
41+
- name: Run npm tests
42+
run: |
43+
npm test
44+

content/v1/cli-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ $ spin add --help
239239
spin-add
240240
Scaffold a new component into an existing application
241241

242-
243242
USAGE:
244243
spin add [OPTIONS] [ARGS]
245244

content/v1/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ enable_shortcodes = true
66
canonical_url = "https://spinframework.com/v2/index"
77
url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v1/index.md"
88

9-
109
---
1110

1211
Spin is a framework and CLI for building and running event-driven microservice applications with WebAssembly (Wasm) components. Spin uses Wasm because it is **sandboxed, portable, and fast**. Millisecond cold start times mean no need to keep applications "warm".
@@ -21,7 +20,6 @@ Many languages have Wasm implementations, so **developers don't have to learn ne
2120
{{card_element "sample" "AI-assisted News Summarizer" "Read an RSS newsfeed and have AI summarize it for you" "/hub/preview/sample_newsreader_ai" "Typescript,Javascript,Ai" true }}
2221
{{blockEnd}}
2322

24-
2523
Or dive into the documentation and get started:
2624

2725
- [Take Spin for a spin](quickstart)

content/v1/kv-store-api-guide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ The key value functions are provided through the `spin_key_value` module in the
117117
from spin_http import Response
118118
from spin_key_value import kv_open_default
119119

120-
121120
def handle_request(request):
122121

123122
store = kv_open_default()

content/v1/python-components.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ This next example will create an outbound request, to obtain a random fact about
178178
```python
179179
from spin_http import Request, Response, http_send
180180

181-
182181
def handle_request(request):
183182

184183
response = http_send(
@@ -273,7 +272,6 @@ from spin_http import Response
273272
from spin_redis import redis_del, redis_get, redis_incr, redis_set, redis_sadd, redis_srem, redis_smembers
274273
from spin_config import config_get
275274

276-
277275
def handle_request(request):
278276

279277
redis_address = config_get("redis_address")

content/v1/quickstart.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ Hello, Fermyon
802802
803803
Congratulations! You just created, built and ran your first Spin application!
804804

805-
806805
## Next Steps
807806

808807
- Learn more about [writing Spin components and manifests](writing-apps)

content/v1/serverless-ai-api-guide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ export const handleRequest: HandleRequest = async function (request: HttpRequest
149149
from spin_http import Response
150150
from spin_llm import llm_infer
151151

152-
153152
def handle_request(request):
154153
prompt="You are a stand up comedy writer. Tell me a joke."
155154
result=llm_infer("llama2-chat", prompt)

content/v1/serverless-ai-hello-world.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ def handle_request(request):
269269
except Exception as e:
270270
return Response(500, {"content-type": "text/plain"}, bytes(f"Error: {str(e)}", "utf-8"))
271271

272-
273272
```
274273

275274
{{ blockEnd }}

content/v2/build.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ command = "cargo build --target wasm32-wasi --release"
6868

6969
For JavaScript and TypeScript applications, you must have [Node.js](https://nodejs.org).
7070

71-
7271
It's normally convenient to put the detailed build instructions in `package.json`. The build script looks like:
7372

7473
<!-- @nocpy -->

0 commit comments

Comments
 (0)