-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 1.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: main
on:
# push trigger required to get coveralls monitoring of default branch
# pull_request required to get PR coveralls comments
push:
branches: [main]
pull_request:
branches: [main]
# no need to bother caching bun deps
# https://github.com/oven-sh/setup-bun/issues/14#issuecomment-1714116221
jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
any_ts_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v44
id: changed-files
with:
files: |
{src,test}/**/*.ts
package.json
tsconfig.json
_test:
needs: changed-files
if: needs.changed-files.outputs.any_ts_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun test --coverage --coverage-reporter lcov --coverage-dir .
- name: Coveralls
uses: coverallsapp/github-action@v2.3.0
with:
format: lcov
file: lcov.info
test:
needs: _test
# workaround for https://github.com/orgs/community/discussions/13690
# https://stackoverflow.com/a/77066140/9771158
if: ${{ !(failure() || cancelled()) }}
runs-on: ubuntu-latest
steps:
- name: Tests OK (passed or skipped)
run: exit 0
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
mise_toml: |
[tasks]
"check:format" = { run = "dprint check --excludes mise.toml" }
"check:lint" = { run = "biome check --config-path=.biome.jsonc" }
"check:types" = { run = "tsc" }
"check" = { depends = "check:*" }
[tools]
bun = "latest"
dprint = "latest"
"npm:@biomejs/biome" = "latest"
"npm:typescript" = "latest"
- run: bun i
- run: mise r check