-
-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (74 loc) · 2.1 KB
/
metrics.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
name: GitHub Actions - metrics
on:
push:
branches:
- master
- develop
paths-ignore:
- '*.ini'
- '*.md'
- '*.yml'
- '*.yaml'
- '.circleci/**'
- '.semaphore/**'
- 'docs/**'
- 'projects/**'
- 'samples/**'
- 'src/**'
- 'test/**'
- 'tools/**'
- 'utils/**'
jobs:
prepare:
runs-on: ubuntu-latest
env:
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
if: >
! contains(github.event.head_commit.message, '[gh skip]') &&
! contains(github.event.head_commit.message, '[skip gh]')
steps:
- run: |
echo "$HEAD_COMMIT_MESSAGE"
fused:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v3
- name: fused
id: fused
run: |
make -C tools/fused
echo "size=$(wc -c < fused-src/iutest.hpp)" >> "${GITHUB_OUTPUT}"
echo "min_size=$(wc -c < fused-src/iutest.min.hpp)" >> "${GITHUB_OUTPUT}"
echo "wandbox_min_size=$(wc -c < fused-src/iutest.wandbox.min.hpp)" >> "${GITHUB_OUTPUT}"
- name: send metrics
run: |
curl \
-H "Content-Type: application/json" \
-X POST \
-d "{\"branch\": \"${GITHUB_REF#refs/heads/}\", \"commit\": \"${GITHUB_SHA}\", \"size\": \"${{ steps.fused.outputs.size }}\", \"min\": \"${{ steps.fused.outputs.min_size }}\", \"wandbox\": \"${{ steps.fused.outputs.wandbox_min_size }}\"}" \
${{ secrets.FUSED_METRICS_WEBHOOK }}
login:
runs-on: ubuntu-latest
needs: prepare
steps:
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
lizard:
runs-on: ubuntu-latest
needs: login
steps:
- uses: actions/checkout@v3
- name: Lizard
uses: docker://srzzumix/lizard
with:
args: -o lizard.html --html ./include
- name: Archive code metrics results
uses: actions/upload-artifact@v3
with:
name: lizard.html
path: lizard.html