Skip to content

Commit 22a0c73

Browse files
committed
Add github test and check workflow
1 parent 248b68b commit 22a0c73

File tree

10 files changed

+103
-33
lines changed

10 files changed

+103
-33
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test and check
2+
on:
3+
push:
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-24.04
8+
strategy:
9+
matrix:
10+
node-version: [20, 22]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v4
15+
with:
16+
version: 10.8.0
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'pnpm'
22+
- name: Install dependencies
23+
run: pnpm install
24+
- name: Run linter
25+
run: pnpm check:turbo
26+
- name: Run linter (formatting)
27+
run: pnpm check:format
28+
- name: Run tests
29+
run: pnpm test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.changeset
2+
.github/
23
pnpm-lock.yaml
34
vitest.config.ts.timestamp*
45
vite.config.ts.timestamp*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ['@repo/eslint-config/default.cjs'],
5+
}

apps/sandbox-container/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7+
"check:types": "run-tsc",
78
"deploy": "wrangler deploy",
89
"dev": "concurrently \"tsx container/index.ts\" \"wrangler dev --var \"ENVIRONMENT:dev\"\"",
910
"build": "docker build .",

apps/workers-observability/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6+
"check:lint": "run-eslint-workers",
7+
"check:types": "run-tsc",
68
"deploy": "wrangler deploy",
79
"dev": "wrangler dev",
810
"start": "wrangler dev",

apps/workers-observability/worker-configuration.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Runtime types generated with [email protected] 2025-03-10
33
export interface Env {
44
OAUTH_KV: KVNamespace;
5+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
56
MCP_OBJECT: DurableObjectNamespace<import("./src/index").MyMCP>;
67
AI: Ai;
78
CLOUDFLARE_CLIENT_ID: string;

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"sideEffects": false,
1919
"scripts": {
2020
"changeset:new": "run-changeset-new",
21+
"check:deps": "pnpm exec syncpack lint",
22+
"check:format": "prettier . --check --cache --ignore-unknown",
23+
"check:turbo": "run-turbo check",
2124
"test:ci": "run-vitest-ci",
2225
"test": "vitest run",
2326
"lint": "prettier . --write",
@@ -32,6 +35,7 @@
3235
"@vitest/ui": "3.0.9",
3336
"prettier": "3.5.3",
3437
"syncpack": "13.0.3",
38+
"turbo": "^2.5.0",
3539
"typescript": "5.5.4",
3640
"vitest": "3.0.9"
3741
},

packages/tools/bin/run-turbo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Helper script for running turbo with tracking disabled
4+
# so that we don't have to export this env var everywhere.
5+
6+
export DO_NOT_TRACK=1
7+
8+
turbo "$@"

pnpm-lock.yaml

Lines changed: 36 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbo.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"tasks": {
4+
"check": {
5+
"dependsOn": ["^check:types", "^check:lint", "check:types", "check:lint"]
6+
},
7+
"check:types": {
8+
"dependsOn": ["^check:types"]
9+
},
10+
"check:lint": {
11+
"dependsOn": ["^check:lint"]
12+
},
13+
"//#check:format": {},
14+
"//#check:deps": {}
15+
}
16+
}

0 commit comments

Comments
 (0)