-
Notifications
You must be signed in to change notification settings - Fork 10
141 lines (116 loc) · 3.96 KB
/
Copy pathpr.yml
File metadata and controls
141 lines (116 loc) · 3.96 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: PR
on:
pull_request:
types:
- ready_for_review
- opened
- reopened
- synchronize
paths-ignore:
- '.changeset/**'
- 'vue-press/**'
concurrency:
group: pr-${{ github.event.pull_request.id }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
jobs:
code-quality:
name: Check Code
runs-on: ubuntu-latest
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
steps:
- name: Determin reporter type
uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event.pull_request.draft }}
if_true: "github-pr-check"
if_false: "github-pr-review"
- name: Determine Checkout Depth
uses: haya14busa/action-cond@v1
id: fetch-depth
with:
cond: ${{ github.actor != 'dependabot[bot]' }}
if_true: '0'
if_false: '1'
- uses: actions/checkout@v7
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: ${{ steps.fetch-depth.outputs.value }}
- name: Setup node and install deps
uses: ./.github/actions/node-setup
with:
turbo-cache: true
- uses: reviewdog/action-setup@v1
- name: Delete GitHub Actions comments
uses: actions/github-script@v9
with:
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
// Delete all GitHub Actions bot comments (they will be regenerated)
const githubActionsComments = comments.filter(comment =>
comment.user && comment.user.login === 'github-actions[bot]'
);
console.log(`Found ${githubActionsComments.length} GitHub Actions comments to delete`);
await Promise.all(
githubActionsComments.map(comment =>
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
})
)
);
- name: Lint source files
uses: mongolyy/reviewdog-action-biome@v2
with:
github_token: ${{ github.token }}
reporter: ${{ steps.reporter.outputs.value }}
level: error
- name: Build fusion-lint
run: pnpm build:lint
- name: Fusion lint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
run: |
pnpm exec fusion-lint changed --reporter=rdjsonl \
| reviewdog \
-name="fusion-lint" \
-f=rdjsonl \
-reporter=${{ steps.reporter.outputs.value }} \
-fail-level=error
- name: Build affected packages
id: build
continue-on-error: true
uses: ./.github/actions/build-packages
with:
only-affected: false
- name: process-build-log
run: node process-turbo-build-log.cjs > tsc-build.log
- name: upload build log
uses: actions/upload-artifact@v7
with:
path: tsc-build.log
- name: Review build log
run: cat tsc-build.log | reviewdog -name=tsc -f=tsc -reporter=${{ steps.reporter.outputs.value }} -fail-level=error
- name: Check if build failed
if: steps.build.outcome == 'failure'
run: exit 1
- name: Create Test Report
run: pnpm test run
- name: Create Test Coverage
id: test-coverage
if: ${{ ! github.event.pull_request.draft }}
run: pnpm test:coverage
- name: Publish test coverage
if: ${{ steps.test-coverage.conclusion == 'success' }}
uses: davelosert/vitest-coverage-report-action@v2.12.2