Skip to content

Commit 8e72e4d

Browse files
authored
Add coverage reports to CI (#49)
* ci: add initial ci scripts Add test & preflight CI scripts to test that I'm doing this right lol * ci: add repo checkout steps (duh) * ci: add dependency caching, polish other steps * ci: add fn-setup reusable workflow Add fn-setup to encapsulate all setup steps and DRY up the main ci workflow * ci: debug deno directory * ci: test out whether specifying DENO_DIR makes caching work properly * ci: add DENO_DIR env variable to Set up Deno action * ci: switch up debugging, remove DENO_DIR * ci: change debug command * ci: try using cache dir from cache action docs * ci: update setup fn workflow with fixes from ci workflow * ci: refactor ci workflow to use setup fn workflow and run tests * ci: move checkout action to outside workflow fn * ci: fix using workflow fn * ci: remove preflight * ci: rename CI workflow to proper file extension * ci: rename setup fn workflow to proper file extension * ci: create fn-setup composite workflow * ci: try using composite workflow instead of reusable workflow * ci: supply paths to deno deps cache action * ci: clean up naming * ci: debug: what happens when we remove the deps cache * ci: debug: now what happens if we take away the cache hash * ci: simplify everything back down to a single CI workflow * ci: be sure to check out repository again * ci: debug: what happens when we remove deps cache * ci: debug: what happens when we take out explicit caching and only specify a hash * ci: debug: what happens when we use it for both * ci: officially remove vestigial caching * ci: debug: what happens when we disable caching for test job * ci: reactivate test job caching * ci: remove redundant runner.os parameter * ci: debug: what happens when we omit installing deps in test job * ci: officially remove vestigial deno install * ci: remove vestigial id props * ci: add biome linting step * ci: clarify when CI workflow runs * ci: make deno permissions stricter * ci: broaden scopes to original breadth * ci: add check command * chore: upgrade dependencies * chore: add permissions * chore: add coverage to .gitignore * ci: add coverage reporting * ci: prevent coverage guard action from uploading coverage report * ci: remove coverage guard action * ci: split coverage report artifacts * ci: shuffle deno tests in CI
1 parent a7980fa commit 8e72e4d

5 files changed

Lines changed: 89 additions & 70 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,21 @@ jobs:
4141
cache-hash: ${{ env.CACHE_KEY_BASE }}-${{ hashFiles('deno.lock') }}
4242

4343
- name: Test
44-
run: deno test --allow-read --no-prompt
44+
run: deno test -P --no-prompt --coverage --shuffle
45+
46+
- name: Upload coverage report
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-report
50+
path: |
51+
coverage/html
52+
coverage/lcov.info
53+
54+
- name: Upload raw coverage files
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: coverage-report-raw
58+
path: coverage/*.json
4559

4660
lint:
4761
name: Lint

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Deno coverage report directory
2+
coverage
3+
14
hide*
25
.vscode
36
*.s

biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",

deno.jsonc

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@
1111
// Import alias
1212
"@root/": "./",
1313
// External dependencies
14-
"@biomejs/biome": "npm:@biomejs/biome@2.2.6",
15-
"@std/assert": "jsr:@std/assert",
16-
"@std/testing": "jsr:@std/testing",
17-
"@std/fmt": "jsr:@std/fmt",
18-
"@std/cli": "jsr:@std/cli",
19-
"@std/fs": "jsr:@std/fs",
20-
"@std/path": "jsr:@std/path",
14+
"@biomejs/biome": "npm:@biomejs/biome@2.3.6",
15+
"@std/assert": "jsr:@std/assert@1.0.16",
16+
"@std/testing": "jsr:@std/testing@1.0.16",
17+
"@std/fmt": "jsr:@std/fmt@1.0.8",
18+
"@std/cli": "jsr:@std/cli@1.0.24",
19+
"@std/fs": "jsr:@std/fs@1.0.20",
20+
"@std/path": "jsr:@std/path@1.1.3",
2121
"chevrotain": "npm:chevrotain@^11.0.3"
2222
},
2323

24+
"test": {
25+
"permissions": {
26+
"read": true
27+
}
28+
},
29+
30+
"permissions": {
31+
"biome": {
32+
"env": true,
33+
"run": true
34+
}
35+
},
36+
2437
// Loosely ported from .prettierrc
2538
"fmt": {
2639
"useTabs": false,

deno.lock

Lines changed: 50 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)