name: ci on: push: branches: [main] pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: oven-sh/setup-bun@v2 with: bun-version: 1.4.3 - uses: dtolnay/rust-toolchain@stable with: targets: wasm32-wasip1 - run: bun install --frozen-lockfile - run: bunx tree-sitter generate working-directory: packages/tree-sitter-lore - run: bun scripts/fixtures.ts - name: Generated files are current run: git diff --exit-code -- packages/tree-sitter-lore/src test/fixtures - run: bun run build - run: bunx tsc --noEmit - run: bun test - uses: actions/setup-node@v4 with: node-version: 20 - name: Bundle runs under node and bun run: | set -o pipefail smoke="--no-repo --remote https://github.com/acme/shop --given packages/cli/test/smoke --diff packages/cli/test/smoke/change.diff --format json" bun run --filter @mattstack/lore build node packages/cli/dist/lore.js select $smoke | jq -e '.rules[0].id == "smoke-rule"' bun packages/cli/dist/lore.js select $smoke | jq -e '.rules[0].id == "smoke-rule"' scratch="$(mktemp -d)" git -C "$scratch" init -q -b main cp -R packages/cli/test/smoke/.lore "$scratch/" git -C "$scratch" add .lore git -C "$scratch" -c user.name=ci -c user.email=ci@example.com -c commit.gpgsign=false commit -q -m rules mkdir "$scratch/src" && echo 'export const label = "USD 10";' > "$scratch/src/price.ts" node packages/cli/dist/lore.js check --repo "$scratch" --format json | jq -e '.rules[0].id == "smoke-rule" and .rules[0].hits[0].file == "src/price.ts"' test "$(bun packages/cli/dist/lore.js --version)" = "$(jq -r .version packages/cli/package.json)" - run: bun run check - run: bunx tree-sitter test working-directory: packages/tree-sitter-lore - run: bun run parse-fixtures working-directory: packages/tree-sitter-lore - run: bun scripts/zed-grammar-rev.ts - run: cargo build --target wasm32-wasip1 working-directory: packages/zed - run: bun run --filter lore-vscode package