66 branches : [main]
77 pull_request :
88 types : [opened, reopened, ready_for_review, synchronize]
9+ merge_group :
10+ types : [checks_requested]
911
1012jobs :
1113 check-translations :
1214 runs-on : ubuntu-latest
1315 steps :
1416 - name : Checkout code
15- uses : actions/checkout@v4
17+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1618 - name : Setup Node.js and pnpm
1719 uses : ./.github/actions/setup-node-pnpm
1820 - name : Verify all translations are complete
2224 runs-on : ubuntu-latest
2325 steps :
2426 - name : Checkout code
25- uses : actions/checkout@v4
27+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2628 - name : Setup Node.js and pnpm
2729 uses : ./.github/actions/setup-node-pnpm
2830 - name : Run knip checks
3234 runs-on : ubuntu-latest
3335 steps :
3436 - name : Checkout code
35- uses : actions/checkout@v4
37+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3638 - name : Setup Node.js and pnpm
3739 uses : ./.github/actions/setup-node-pnpm
3840 - name : Lint
@@ -49,33 +51,73 @@ jobs:
4951 - os : ubuntu-latest
5052 name : ubuntu-latest
5153 codecov-flag : ubuntu
54+ upload-coverage : true
5255 - os : windows-latest
5356 name : windows-latest
5457 codecov-flag : windows
58+ upload-coverage : false
5559 steps :
5660 - name : Checkout code
57- uses : actions/checkout@v4
61+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5862 - name : Setup Node.js and pnpm
5963 uses : ./.github/actions/setup-node-pnpm
60- - name : Cache Turbo
61- uses : actions/cache@v4
64+ - name : Restore Turbo cache
65+ id : turbo-cache
66+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
6267 with :
6368 path : .turbo/cache
6469 key : ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
6570 restore-keys : |
6671 ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml') }}-
6772 ${{ runner.os }}-turbo-
68- - name : Run unit tests with coverage
69- run : pnpm test:coverage
70- - name : Upload coverage to Codecov
71- uses : codecov/codecov-action@v4
73+ - name : Run non-core coverage
74+ run : pnpm turbo run test:coverage --filter="!@roo-code/core" --log-order grouped --output-logs new-only
75+ - name : Run core unit coverage
76+ run : pnpm turbo run test:coverage:unit --filter="@roo-code/core" --log-order grouped --output-logs new-only
77+ - name : Run core integration coverage
78+ run : pnpm turbo run test:coverage:integration --filter="@roo-code/core" --log-order grouped --output-logs new-only
79+ - name : Save Turbo cache
80+ if : steps.turbo-cache.outputs.cache-hit != 'true'
81+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
82+ with :
83+ path : .turbo/cache
84+ key : ${{ steps.turbo-cache.outputs.cache-primary-key }}
85+ # Only ubuntu uploads coverage. Windows still runs the same test
86+ # lanes for behavioral confidence, but duplicating coverage uploads
87+ # there mostly adds Codecov overhead without changing pass/fail
88+ # behavior.
89+ # Coverage is uploaded in three separate steps so each LCOV gets the
90+ # correct flag set. Codecov double-counts overlapping lines when a
91+ # single upload carries multiple flags whose paths overlap, so the
92+ # two core lanes (which both cover packages/core/src/**) must be
93+ # uploaded individually with their own lane flag.
94+ # See https://docs.codecov.com/docs/flags
95+ - name : Upload non-core coverage to Codecov
96+ if : matrix.upload-coverage
97+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
7298 with :
7399 files : >-
74100 src/coverage/lcov.info,
75101 webview-ui/coverage/lcov.info,
76- packages/core/coverage/lcov.info,
77102 packages/cloud/coverage/lcov.info,
78103 packages/telemetry/coverage/lcov.info,
79104 apps/cli/coverage/lcov.info
105+ disable_search : true
80106 flags : ${{ matrix.codecov-flag }}
81107 token : ${{ secrets.CODECOV_TOKEN }}
108+ - name : Upload core unit coverage to Codecov
109+ if : matrix.upload-coverage
110+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
111+ with :
112+ files : packages/core/coverage/unit/lcov.info
113+ disable_search : true
114+ flags : ${{ matrix.codecov-flag }},core-unit
115+ token : ${{ secrets.CODECOV_TOKEN }}
116+ - name : Upload core integration coverage to Codecov
117+ if : matrix.upload-coverage
118+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
119+ with :
120+ files : packages/core/coverage/integration/lcov.info
121+ disable_search : true
122+ flags : ${{ matrix.codecov-flag }},core-integration
123+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments