Skip to content

Commit 2eb7c3e

Browse files
authored
Add Github workflow for Dart Code Metrics (#2092)
1 parent 79a9bc9 commit 2eb7c3e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/dcm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# A CI workflow to run the Dart Code Metrics analyzer (https://dcm.dev).
2+
3+
name: Dart Code Metrics
4+
5+
on:
6+
pull_request_target
7+
8+
jobs:
9+
dcm:
10+
name: Dart Code Metrics
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install DCM
14+
run: |
15+
sudo apt-get update
16+
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
17+
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
18+
sudo apt-get update
19+
sudo apt-get install dcm
20+
sudo chmod +x /usr/bin/dcm
21+
- name: Setup Dart SDK
22+
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
23+
with:
24+
sdk: dev
25+
- id: checkout
26+
name: Checkout repository
27+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
28+
- id: dwds_pub_upgrade
29+
name: dwds; dart pub upgrade
30+
run: dart pub upgrade
31+
if: "always() && steps.checkout.conclusion == 'success'"
32+
working-directory: dwds
33+
- name: Run DCM on DWDS
34+
run: dcm analyze --ci-key="${{ secrets.DCM_CI_KEY }}" --email="${{ secrets.DCM_EMAIL }}" lib
35+
working-directory: dwds

0 commit comments

Comments
 (0)