Skip to content

Commit 6dbe0f0

Browse files
authored
chore(ci): update and add action (#6)
1 parent d68675b commit 6dbe0f0

File tree

13 files changed

+203
-123
lines changed

13 files changed

+203
-123
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: run tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- '**.md'
10+
pull_request:
11+
paths-ignore:
12+
- 'docs/**'
13+
- '**.md'
14+
15+
concurrency:
16+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17+
cancel-in-progress: true
18+
19+
jobs:
20+
ci:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
steps:
24+
- uses: actions/checkout@releases/v4.0.0
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
- name: npm ci
29+
uses: nick-fields/retry@v3.0.0
30+
with:
31+
max_attempts: 10
32+
timeout_minutes: 15
33+
retry_on: error
34+
command: npm ci
35+
- name: Run build
36+
run: npm run build
37+
- name: Run backend tests
38+
run: cd web/backend && npm run test

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"start": "wattpm start"
88
},
99
"dependencies": {
10-
"@platformatic/composer": "^2.30.0",
11-
"@platformatic/runtime": "^2.30.0",
12-
"wattpm": "^2.30.0"
10+
"@platformatic/composer": "^2.30.1",
11+
"@platformatic/runtime": "^2.30.1",
12+
"wattpm": "^2.30.1"
1313
},
1414
"workspaces": [
1515
"web/*",

watt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://schemas.platformatic.dev/wattpm/2.26.1.json",
2+
"$schema": "https://schemas.platformatic.dev/wattpm/2.30.1.json",
33
"server": {
44
"hostname": "127.0.0.1",
55
"port": 3042

web/backend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"typescript": "^5.5.4"
1414
},
1515
"dependencies": {
16-
"@platformatic/control": "^2.30.0",
17-
"@platformatic/service": "^2.30.0"
16+
"@platformatic/control": "^2.30.1",
17+
"@platformatic/service": "^2.30.1"
1818
}
1919
}

web/backend/platformatic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://schemas.platformatic.dev/@platformatic/service/2.26.1.json",
2+
"$schema": "https://schemas.platformatic.dev/@platformatic/service/2.30.1.json",
33
"service": {
44
"openapi": true
55
},

web/backend/plugins/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/// <reference path="../global.d.ts" />
21
import { FastifyInstance, FastifyPluginOptions } from 'fastify'
32

43
export default async function (fastify: FastifyInstance, opts: FastifyPluginOptions) {
4+
fastify.log.debug({ pltConfig: fastify.platformatic.configManager.current }, 'pltConfig')
55
fastify.decorate('example', 'foobar')
66
}

web/backend/routes/root.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="../global.d.ts" />
21
import { FastifyInstance, FastifyPluginOptions } from 'fastify'
32
import { JsonSchemaToTsProvider } from '@fastify/type-provider-json-schema-to-ts'
43
import { RuntimeApiClient } from '@platformatic/control'
@@ -29,8 +28,7 @@ export default async function (fastify: FastifyInstance, opts: FastifyPluginOpti
2928
let runtimes = await api.getRuntimes()
3029

3130
if (!request.query.includeAdmin) {
32-
// FIXME: remove `any` once the proper type is passed from `@platformatic/control`
33-
runtimes = runtimes.filter((runtime: any) => runtime.packageName !== 'watt-admin')
31+
runtimes = runtimes.filter((runtime) => runtime.packageName !== 'watt-admin')
3432
}
3533

3634
return runtimes

web/backend/test/routes/root.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ test('root', async (t) => {
66
const server = await getServer(t)
77
const res = await server.inject({
88
method: 'GET',
9-
url: '/example'
9+
url: '/runtimes'
1010
})
1111

1212
assert.strictEqual(res.statusCode, 200)
13-
assert.deepStrictEqual(res.json(), {
14-
hello: 'foobar'
15-
})
13+
assert.deepStrictEqual(res.json(), [])
1614
})

web/composer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"typescript": "^5.5.4"
1313
},
1414
"dependencies": {
15-
"@platformatic/composer": "^2.30.0"
15+
"@platformatic/composer": "^2.30.1"
1616
}
1717
}

0 commit comments

Comments
 (0)