Repository navigation
129 lines (124 loc) · 4.41 KB
/
Copy pathci.yml
File metadata and controls
129 lines (124 loc) · 4.41 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
129
name: CI
on:
pull_request:
push:
branches: [master]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Checkout pinned Craft baseline
run: |
git clone --filter=blob:none https://github.com/craft-ai-agents/craft-agents-oss.git "$RUNNER_TEMP/craft-agents-oss"
git -C "$RUNNER_TEMP/craft-agents-oss" checkout --detach 8df01c5d0ac73c35add5954e6f190ce038d35845
- name: Install dependencies
env:
GITHUB_TOKEN: ${{ github.token }}
run: bun run scripts/run-with-retry.ts --attempts 4 --base-delay-ms 2000 -- bun install --frozen-lockfile
- name: Lint
run: bun run lint
env:
CRAFT_AGENT_SOURCE: ${{ runner.temp }}/craft-agents-oss
- name: Audit Craft source reuse
run: bun run audit:craft-reuse
env:
CRAFT_AGENT_SOURCE: ${{ runner.temp }}/craft-agents-oss
- name: Validate types, focused tests, document tools, and locales
run: bun run validate:ci
- name: Run test suite
run: bun run test
- name: Build WebUI
env:
NODE_OPTIONS: --max-old-space-size=4096
run: bun run webui:build
- name: Build CLI
run: bun run cli:build
- name: Check whitespace errors
run: git diff --check
package:
name: Package ${{ matrix.target }}-${{ matrix.arch }}
needs: quality
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
target: mac
platform: darwin
arch: arm64
- os: windows-latest
target: win
platform: win32
arch: x64
- os: ubuntu-latest
target: linux
platform: linux
arch: x64
runs-on: ${{ matrix.os }}
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: astral-sh/setup-uv@v6
- name: Install dependencies
env:
GITHUB_TOKEN: ${{ github.token }}
run: bun run scripts/run-with-retry.ts --attempts 4 --base-delay-ms 2000 -- bun install --frozen-lockfile
- name: Build desktop application
env:
MKAGENT_AUTO_UPDATE_ENABLED: ${{ matrix.target != 'mac' }}
run: bun run electron:build
- name: Package desktop application
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
working-directory: apps/electron
shell: bash
run: |
args=(--config electron-builder.yml --${{ matrix.target }} --${{ matrix.arch }} --publish never)
if [ "${{ matrix.target }}" = "mac" ]; then
args+=("-c.mac.identity=-" "-c.mac.hardenedRuntime=false")
fi
bun run ../../scripts/run-with-retry.ts --attempts 4 --base-delay-ms 5000 -- bunx electron-builder "${args[@]}"
- name: Build headless server
shell: bash
run: bun run scripts/build-server.ts --output="dist/MkAgent-server-ci-${{ matrix.platform }}-${{ matrix.arch }}" --compress
- name: Compress Windows headless server
if: runner.os == 'Windows'
shell: pwsh
run: Compress-Archive -Path "dist/MkAgent-server-ci-${{ matrix.platform }}-${{ matrix.arch }}/*" -DestinationPath "dist/MkAgent-server-ci-${{ matrix.platform }}-${{ matrix.arch }}.zip"
- name: Upload packaged artifacts
uses: actions/upload-artifact@v4
with:
name: ci-${{ matrix.target }}-${{ matrix.arch }}-${{ github.sha }}
if-no-files-found: error
retention-days: 7
compression-level: 0
path: |
apps/electron/release/*.dmg
apps/electron/release/*.zip
apps/electron/release/*.exe
apps/electron/release/*.AppImage
apps/electron/release/*.blockmap
apps/electron/release/latest*.yml
dist/MkAgent-server-*.tar.gz
dist/MkAgent-server-*.zip