Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,32 @@ jobs:
run: make test-coverage
- name: Merge and generate coverage report
run: |
llvm-profdata merge -sparse $(find . -type f -path '*/.build/*/debug/codecov/*.profdata') -o default.profdata
mapfile -t PROFDATA_FILES < <(find . -type f -path '*/codecov/*.profdata' -print)
if [ "${#PROFDATA_FILES[@]}" -eq 0 ]; then
echo "No coverage profile data found"
exit 1
fi
llvm-profdata merge -sparse "${PROFDATA_FILES[@]}" -o default.profdata
for file in **/Tests; do
BIN_PATH="$(swift build --show-bin-path --package-path "$(dirname "$file")")"
XCTEST_PATHS=$(find "${BIN_PATH}" -name '*.xctest')
for XCTEST_PATH in $XCTEST_PATHS; do
echo "Processing $XCTEST_PATH"
# Export the code coverage for the current subproject and append to coverage.lcov
llvm-cov export "${XCTEST_PATH}" \
-instr-profile=default.profdata \
-format lcov >> coverage.lcov \
-ignore-filename-regex=".build/repositories/.*|.*/JAMTests/.*"
done
while IFS= read -r TEST_BUNDLE; do
echo "Processing $TEST_BUNDLE"
llvm-cov export "${TEST_BUNDLE}" \
-instr-profile=default.profdata \
-format lcov >> coverage.lcov \
-ignore-filename-regex=".build/repositories/.*|.*/JAMTests/.*"
done < <(find "${BIN_PATH}" -type d -name '*.xctest' -print)

while IFS= read -r TEST_LIBRARY; do
TEST_RUNNER="${TEST_LIBRARY%.so}-test-runner"
if [ -f "${TEST_RUNNER}" ]; then
echo "Processing $TEST_LIBRARY"
llvm-cov export "${TEST_LIBRARY}" \
-instr-profile=default.profdata \
-format lcov >> coverage.lcov \
-ignore-filename-regex=".build/repositories/.*|.*/JAMTests/.*"
fi
done < <(find "${BIN_PATH}" -type f -name '*.so' -print)
done
- uses: codecov/codecov-action@v4
with:
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/polka-codes-review-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ concurrency:
cancel-in-progress: true

jobs:
review_gemini:
name: Review With Gemini
review_polka:
name: Review With Polka Codes
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
Expand All @@ -29,19 +29,29 @@ jobs:
with:
fetch-depth: 0

- name: Google Auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Check Polka Codes configuration
id: check-polka-config
shell: bash
env:
POLKA_BASE_URL: ${{ secrets.POLKA_BASE_URL }}
POLKA_API_KEY: ${{ secrets.POLKA_API_KEY }}
run: |
if [[ -n "$POLKA_BASE_URL" && -n "$POLKA_API_KEY" ]]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "Polka Codes secrets are not configured; skipping review."
fi

- name: Run Polka Codes (Gemini)
- name: Run Polka Codes
if: steps.check-polka-config.outputs.enabled == 'true'
uses: polka-codes/action@master
with:
pr_number: ${{ github.event.inputs.pr_number || github.event.number }}
review: true
env:
POLKA_API_PROVIDER: google-vertex
POLKA_MODEL: gemini-3-pro-preview
POLKA_API_PROVIDER: openai-compatible
POLKA_BASE_URL: ${{ secrets.POLKA_BASE_URL }}
POLKA_API_KEY: ${{ secrets.POLKA_API_KEY }}
POLKA_MODEL: gpt-5.6-sol
GITHUB_TOKEN: ${{ github.token }}
GOOGLE_VERTEX_LOCATION: global
GOOGLE_VERTEX_PROJECT: ${{ secrets.GOOGLE_VERTEX_PROJECT }}
9 changes: 8 additions & 1 deletion Boka/Tests/BokaTests/BokaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import Logging
import Node
import Testing

#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
#endif

struct BokaTests {
@Test func commandWithInvalidPaths() async throws {
let invalidChainPath = "/path/to/wrong/file.json"
Expand Down Expand Up @@ -314,7 +320,8 @@ struct BokaTests {
}
}

@Test func fuzzEnvironmentRejectsUnwritableDataDirectory() throws {
@Test(.disabled(if: geteuid() == 0, "requires a non-root user"))
func fuzzEnvironmentRejectsUnwritableDataDirectory() throws {
let root = try makeTemporaryDirectory()
defer {
try? FileManager.default.removeItem(at: root)
Expand Down
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,20 @@ test-all: test test-cargo

.PHONY: test-coverage
test-coverage:
@for pkg in $(TEST_PACKAGES); do \
@failed=""; \
for pkg in $(TEST_PACKAGES); do \
echo "Running coverage for $$pkg..."; \
swift test --enable-code-coverage --package-path "$$pkg"; \
done
if swift test --enable-code-coverage --package-path "$$pkg"; then \
echo " ✓ PASS"; \
else \
echo " ✗ FAIL"; \
failed="$$failed $$pkg"; \
fi; \
done; \
if [ -n "$$failed" ]; then \
echo "Failed packages:$$failed"; \
exit 1; \
fi

.PHONY: build
build: githooks deps
Expand Down
Loading