-
Notifications
You must be signed in to change notification settings - Fork 6
103 lines (83 loc) · 2.7 KB
/
pr.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
fetch-depth: ${{ steps.fetch-depth.outputs.value }}
- name: Setup node and install deps
uses: ./.github/workflows/actions/node-setup
with:
turbo-cache: true
- uses: reviewdog/action-setup@v1
- name: Delete outdated ReviewDog comments
uses: Ardiannn08/[email protected]
with:
token: ${{ github.token }}
filter-user: "reviewdog"
mode: "delete"
- name: Lint source files
run: reviewdog --runners=eslint -name=eslint -reporter=${{ steps.reporter.outputs.value }} -fail-on-error
- name: Build affected packages
id: build
continue-on-error: true
uses: ./.github/workflows/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@v4
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-on-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/[email protected]