-
Notifications
You must be signed in to change notification settings - Fork 75
41 lines (38 loc) · 1.46 KB
/
dcm.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
# A CI workflow to run the Dart Code Metrics analyzer (https://dcm.dev).
name: Dart Code Metrics
on:
pull_request_target:
types: [opened, reopened, labeled, unlabeled]
branches:
- master
jobs:
dcm:
if: contains(github.event.pull_request.labels.*.name, 'run-dcm-workflow')
name: Dart Code Metrics
runs-on: ubuntu-latest
steps:
- name: Install DCM
run: |
sudo apt-get update
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update
sudo apt-get install dcm
sudo chmod +x /usr/bin/dcm
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
ref: "${{ github.event.pull_request.head.sha }}"
- id: dwds_pub_upgrade
name: dwds; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: dwds
- name: Run DCM on DWDS
run: dcm analyze --ci-key="${{ secrets.DCM_CI_KEY }}" --email="${{ secrets.DCM_EMAIL }}" lib
working-directory: dwds