Repository navigation
91 lines (76 loc) · 3.03 KB
/
Copy pathci.yml
File metadata and controls
91 lines (76 loc) · 3.03 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup
- name: Check
run: npm run check
workspace-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup
- name: Test scripts and other workspaces
run: ./test.sh other --shard=${{ matrix.shard }}/2
coding-agent:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup
id: setup
# Opt in for hosted benchmarks; retain only after restore/save overhead is recovered.
- name: Compute Vitest cache compatibility
if: vars.VITEST_FS_CACHE == 'true'
id: vitest-cache-key
env:
CACHE_PREFIX: vitest-fs-v2-${{ runner.os }}-${{ runner.arch }}-node-${{ steps.setup.outputs.node-version }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('vitest.base.ts', 'packages/coding-agent/vitest.config.ts', '**/tsconfig*.json') }}-shard-${{ matrix.shard }}-of-4-
run: echo "prefix=$CACHE_PREFIX" >> "$GITHUB_OUTPUT"
- name: Restore Vitest module cache
if: vars.VITEST_FS_CACHE == 'true'
id: vitest-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: node_modules/.experimental-vitest-cache
key: ${{ steps.vitest-cache-key.outputs.prefix }}${{ github.sha }}
restore-keys: ${{ steps.vitest-cache-key.outputs.prefix }}
- name: Test
run: ./test.sh coding-agent --shard=${{ matrix.shard }}/4 --pool=forks --maxWorkers=2 --isolate
- name: Save Vitest module cache
if: success() && vars.VITEST_FS_CACHE == 'true' && steps.vitest-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: node_modules/.experimental-vitest-cache
key: ${{ steps.vitest-cache.outputs.cache-primary-key }}
# Keep the existing required check name and fail it if any suite fails or is skipped.
build-check-test:
if: always()
needs: [build-check, workspace-tests, coding-agent]
runs-on: ubuntu-latest
steps:
- name: Require all checks and test shards
env:
BUILD: ${{ needs.build-check.result }}
WORKSPACES: ${{ needs.workspace-tests.result }}
CODING_AGENT: ${{ needs.coding-agent.result }}
run: test "$BUILD" = success && test "$WORKSPACES" = success && test "$CODING_AGENT" = success