Skip to content
16 changes: 16 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,22 @@ jobs:
- name: Install ripgrep
run: command -v rg || (sudo apt-get update && sudo apt-get install -y ripgrep)

- name: Verify shell placeholder compilation in Bash
if: matrix.shard == 1
working-directory: apps/sim
env:
SHELL_PLACEHOLDERS_REPORT_PATH: ${{ runner.temp }}/shell-placeholders.json
run: bun scripts/test-shell-placeholders-e2e.ts

- name: Upload shell placeholder execution report
if: failure() && matrix.shard == 1
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: shell-placeholders
path: ${{ runner.temp }}/shell-placeholders.json
if-no-files-found: warn
retention-days: 7

- name: Run tests
env:
NODE_OPTIONS: '--no-warnings --max-old-space-size=8192'
Expand Down
8 changes: 4 additions & 4 deletions apps/sim/lib/execution/code-placeholders/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ export function createOffsetRangeLookup(
* The placeholders lying wholly inside `[start, end]`. Occurrences are ordered and never
* overlap, so the matches are one contiguous run found by bisection.
*/
export function occurrencesWithin(
occurrences: readonly CodePlaceholderOccurrence[],
export function occurrencesWithin<T extends Pick<CodePlaceholderOccurrence, 'start' | 'end'>>(
occurrences: readonly T[],
start: number,
end: number
): CodePlaceholderOccurrence[] {
const matches: CodePlaceholderOccurrence[] = []
): T[] {
const matches: T[] = []
for (
let index = partitionPoint(occurrences, (occurrence) => occurrence.start < start);
index < occurrences.length && occurrences[index].end <= end;
Expand Down
Loading
Loading