Skip to content

Commit 16f1f8c

Browse files
committed
ci(workflows): [ci] bun tests
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent ea4055f commit 16f1f8c

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

.github/infrastructure.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ branches:
3535
- context: test (22)
3636
- context: test (21)
3737
- context: test (20)
38+
- context: test-bun (canary)
39+
- context: test-bun (latest)
40+
- context: test-bun (1.2.0)
3841
- context: typescript
3942
strict: true
4043
restrictions: null

.github/workflows/ci.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ permissions:
4343
contents: read
4444
env:
4545
CACHE_PATH: node_modules
46+
COVERAGE_SUMMARY: ./coverage/coverage-summary.json
4647
HUSKY: 0
48+
PCT: .total.branches.pct + .total.functions.pct + .total.lines.pct + .total.statements.pct
4749
REF: ${{ github.head_ref || github.ref }}
4850
REF_NAME: ${{ github.head_ref || github.ref_name }}
4951
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -253,9 +255,6 @@ jobs:
253255
- 20
254256
env:
255257
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
256-
COVERAGE_SUMMARY: ./coverage/coverage-summary.json
257-
NODE_NO_WARNINGS: 1
258-
PCT: .total.branches.pct + .total.functions.pct + .total.lines.pct + .total.statements.pct
259258
steps:
260259
- id: checkout
261260
name: Checkout ${{ env.REF_NAME }}
@@ -286,9 +285,6 @@ jobs:
286285
with:
287286
data: ${{ env.COVERAGE_SUMMARY }}
288287
filter: "'${{ env.PCT }}'"
289-
- id: pct
290-
name: Print coverage points
291-
run: echo ${{ steps.coverage.outputs.result }}
292288
- id: report
293289
name: Upload report
294290
uses: actions/[email protected]
@@ -331,6 +327,47 @@ jobs:
331327
if: fromJson(steps.coverage.outputs.result) != 400
332328
name: Coverage threshold failure (${{ steps.coverage.outputs.result }})
333329
run: yarn test:cov:reports
330+
test-bun:
331+
needs: preflight
332+
runs-on: ubuntu-latest
333+
strategy:
334+
fail-fast: false
335+
matrix:
336+
bun-version:
337+
- canary
338+
- latest
339+
- 1.2.0
340+
steps:
341+
- id: checkout
342+
name: Checkout ${{ env.REF_NAME }}
343+
uses: actions/[email protected]
344+
with:
345+
persist-credentials: false
346+
ref: ${{ env.REF }}
347+
- id: bun
348+
name: Setup Bun (${{ matrix.bun-version }})
349+
uses: oven-sh/[email protected]
350+
with:
351+
bun-version: ${{ matrix.bun-version }}
352+
- id: cache
353+
name: Restore dependencies cache
354+
uses: actions/[email protected]
355+
with:
356+
key: ${{ needs.preflight.outputs.cache-key }}
357+
path: ${{ env.CACHE_PATH }}
358+
- id: test
359+
name: Run tests
360+
run: yarn test:cov --coverage.thresholds.100=false
361+
- id: coverage
362+
name: Get coverage points
363+
uses: flex-development/[email protected]
364+
with:
365+
data: ${{ env.COVERAGE_SUMMARY }}
366+
filter: "'${{ env.PCT }}'"
367+
- id: coverage-failure
368+
if: fromJson(steps.coverage.outputs.result) != 400
369+
name: Coverage threshold failure (${{ steps.coverage.outputs.result }})
370+
run: yarn test:cov:reports
334371
artifacts:
335372
needs:
336373
- commitlint
@@ -339,6 +376,7 @@ jobs:
339376
- preflight
340377
- spelling
341378
- test
379+
- test-bun
342380
- typescript
343381
runs-on: ubuntu-latest
344382
steps:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
## What is this?
2929

30-
`kronk` is a utility for building command-line applications.
30+
`kronk` is a utility for building command-line applications in [node.js][nodejs] and [bun][].
3131

3232
## Install
3333

@@ -77,6 +77,8 @@ community you agree to abide by its terms.
7777

7878
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
7979

80+
[nodejs]: https://nodejs.org
81+
8082
[typescript]: https://www.typescriptlang.org
8183

8284
[yarn]: https://yarnpkg.com

0 commit comments

Comments
 (0)