forked from XiaomiMiMo/MiMo-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (159 loc) · 4.85 KB
/
Copy pathci.yml
File metadata and controls
171 lines (159 loc) · 4.85 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CI: true
jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-bun
- name: Run typecheck
run: bun typecheck
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-bun
- name: Run oxlint
run: bun lint
- name: Check formatting
run: npx prettier --check "packages/opencode/src/**/*.ts" "packages/opencode/test/**/*.ts"
test:
name: Test (shard ${{ matrix.shard }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: ["1/4", "2/4", "3/4", "4/4"]
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-bun
- name: Configure git identity
run: |
git config --global user.email "ci@mimo.ai"
git config --global user.name "mimo-ci"
- name: Run unit tests (shard ${{ matrix.shard }})
timeout-minutes: 8
working-directory: packages/opencode
run: bun run test:ci --shard ${{ matrix.shard }}
- name: Upload JUnit
if: always()
uses: actions/upload-artifact@v7
with:
name: junit-shard-${{ strategy.job-index }}
path: packages/opencode/.artifacts/unit/junit.xml
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-bun
- name: Install skylos
run: pip install skylos
- name: Run skylos security scan
run: skylos suite packages/opencode/src/plugin --json || true
- name: Upload results
if: always()
uses: actions/upload-artifact@v7
with:
name: skylos-results
path: packages/opencode/.artifacts/security/
quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-bun
- name: Install repowise
run: pip install repowise
- name: Run repowise health
run: repowise health packages/opencode/src/plugin --json || true
- name: Upload results
if: always()
uses: actions/upload-artifact@v7
with:
name: repowise-results
path: packages/opencode/.artifacts/quality/
python:
name: Python (if present)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check for Python files
id: check
run: |
if find . -name "pyproject.toml" -o -name "setup.py" -o -name "requirements.txt" | grep -v node_modules | head -1; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Python
if: steps.check.outputs.found == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python deps
if: steps.check.outputs.found == 'true'
run: pip install ruff mypy pytest
- name: Run ruff
if: steps.check.outputs.found == 'true'
run: ruff check .
- name: Run mypy
if: steps.check.outputs.found == 'true'
run: mypy . --ignore-missing-imports
- name: Run pytest
if: steps.check.outputs.found == 'true'
run: python -m pytest tests/ -x --timeout=60 || true
rust:
name: Rust (if present)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check for Cargo.toml
id: check
run: |
if find . -name "Cargo.toml" | grep -v node_modules | head -1; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Rust
if: steps.check.outputs.found == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Cargo check
if: steps.check.outputs.found == 'true'
run: cargo check
- name: Cargo test
if: steps.check.outputs.found == 'true'
run: cargo test --no-fail-fast || true
go:
name: Go (if present)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check for go.mod
id: check
run: |
if find . -name "go.mod" | grep -v node_modules | head -1; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Go
if: steps.check.outputs.found == 'true'
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Go vet
if: steps.check.outputs.found == 'true'
run: go vet ./...
- name: Go test
if: steps.check.outputs.found == 'true'
run: go test ./... || true