-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (68 loc) · 2.32 KB
/
bun-types-test.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
71
72
73
74
75
76
77
78
79
name: Bun CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ "main" ]
paths:
- "app/**"
- "public/**"
- "next.config.js"
- "package.json"
- "postcss.config.js"
- "tailwind.config.ts"
- "tsconfig.json"
- "yarn.lock"
pull_request:
branches: [ "main" ]
paths:
- "app/**"
- "public/**"
- "next.config.js"
- "package.json"
- "postcss.config.js"
- "tailwind.config.ts"
- "tsconfig.json"
- "yarn.lock"
workflow_dispatch:
jobs:
build:
name: type-tests
runs-on: ubuntu-latest
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun i
- name: Format app
run: bun run lint
- name: Build app
run: bun run build
- name: Test app
run: bun test
- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: test-failures-${{ github.workflow }}
message: |
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ github.workflow }}:
${{ steps.test.outputs.failing_tests }}
**[View test output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>
- name: Uncomment on PR
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: test-failures-${{ github.workflow }}
mode: upsert
create_if_not_exists: false
message: |
✅ test failures on ${{ github.workflow }} have been resolved.
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>