Repository navigation
128 lines (110 loc) · 4.69 KB
/
Copy path_check_code.yaml
File metadata and controls
128 lines (110 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Code checks
on:
workflow_call:
workflow_dispatch:
jobs:
actions_lint_check:
name: Actions lint check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Run actionlint
uses: rhysd/actionlint@v1.7.10
lint_check:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2
- name: Lint
run: pnpm run lint
- name: Check formatting with oxfmt
run: pnpm run format:check
- name: Check AGENTS.md links
run: pnpm run check:agents
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2
- name: Build
run: pnpm run build
test:
name: Test (Node.js ${{ matrix.node-version }})
strategy:
matrix:
# 22 = minimum supported (matches package.json#engines.node).
# 22/24 = active LTS lines. 26 = current.
node-version: [22, 24, 26]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2
- name: Test
run: pnpm run test
type_check:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2
- name: Type checks
run: pnpm run type-check
docker_build_smoke_test:
# The Dockerfile is consumed by the external Docker Hub auto-build integration
# (see README) but no other CI job builds it, so breakage — like the pnpm v10+
# `pnpm deploy` regression — only surfaces post-merge. This job builds the image
# on every PR / master push and exercises the entrypoint to keep that surface honest.
name: Docker build & smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: apify-mcp-server:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test — CLI help output
# Confirms the entrypoint starts and yargs renders the usage block.
run: |
docker run --rm apify-mcp-server:ci --help | grep -F 'Usage: stdio.js'
- name: Smoke test — MCP initialize handshake over stdio
# Validates the server boots in the runtime image and speaks MCP.
# APIFY_TOKEN can be any non-empty string — the initialize handshake
# does not hit the Apify API, so no secret is required.
run: |
request='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1.0"}}}'
response=$(printf '%s\n' "$request" | docker run --rm -i -e APIFY_TOKEN=apify_api_dummy_for_smoke apify-mcp-server:ci)
echo "--- raw response ---"
echo "$response"
echo "--- assertions ---"
echo "$response" | grep -m1 '"id":1' | jq -e '.result.serverInfo.name == "apify-mcp-server"'
echo "$response" | grep -m1 '"id":1' | jq -e '.result.protocolVersion != null'