-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (79 loc) · 2.86 KB
/
pr-compliance-check.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
name: "Check PR complains with requirements"
on:
pull_request_target:
workflow_run:
workflows: ['Run tests for PR']
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number }}
cancel-in-progress: true
jobs:
reviewdog:
if: github.event_name == 'workflow_run'
strategy:
matrix:
include:
- tool: ktlint
- tool: detekt
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: Download benchmark results
uses: dawidd6/action-download-artifact@v6
with:
name: style-reports
path: reports/
run_id: ${{ github.event.workflow_run.id }}
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run reviewdog ${{ matrix.tool }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_PULL_REQUEST: ${{ github.event.pull_request[0].number }}
CI_REPO_OWNER: ${{ github.repository_owner }}
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_COMMIT: ${{ github.event.workflow_run.pull_requests[0].head.repo }}
run: echo reports/${{ matrix.tool }}-reviewdog.out | reviewdog -tee -reporter=github-pr-review
danger-check:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
permissions:
pull-requests: write
statuses: write
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: Danger
uses: danger/[email protected]
with:
run-mode: ci
dangerfile: Dangerfile.df.kts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-coverage:
runs-on: ubuntu-latest
if: github.event.workflow_run.actor.name != 'dependabot[bot]' && github.repository == 'OptimumCode/json-schema-validator' && github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_sha }}
- name: Download benchmark results
uses: dawidd6/action-download-artifact@v6
with:
name: coverage-reports
path: reports/
run_id: ${{ github.event.workflow_run.id }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
override_branch: ${{ github.event.workflow_run.pull_requests[0].head.ref }}
override_commit: ${{ github.event.workflow_run.pull_requests[0].head.sha }}
override_pr: ${{ github.event.workflow_run.pull_requests[0].number }}
token: ${{ secrets.CODECOV_TOKEN }}