diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 787a83d..b8f9872 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -50,7 +50,14 @@ jobs: bun-version: latest - name: Test run: | - bun test + # `bun test` exits 1 when it matches no test files. Skip it while + # the repo has none rather than failing every run; the first test + # file added turns it back on by itself. + if git ls-files | grep -qE '\.(test|spec)\.(js|jsx|ts|tsx)$'; then + bun test + else + echo "no test files yet — skipping" + fi build: name: Build runs-on: ubuntu-24.04 diff --git a/.github/workflows/release_validation.yaml b/.github/workflows/release_validation.yaml index bd4e19c..55aadcf 100644 --- a/.github/workflows/release_validation.yaml +++ b/.github/workflows/release_validation.yaml @@ -6,7 +6,7 @@ on: jobs: validation: name: Validation - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.husky/pre-commit b/.husky/pre-commit index 5b5bea2..b6e2c25 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,8 @@ -bun test +# `bun test` exits 1 when it matches no test files, which blocks every +# commit in a repo that has none yet. Run it only when there is something +# to run — the first test file added turns it back on by itself. +if git ls-files | grep -qE '\.(test|spec)\.(js|jsx|ts|tsx)$'; then + bun test +fi + bun lint-staged