Merge pull request #712 from srz-zumix/feature/on_push #309
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: fused | |
id: fused | |
run: | | |
make -C tools/fused | |
{ | |
echo "size=$(wc -c < fused-src/iutest.hpp)" | |
echo "min_size=$(wc -c < fused-src/iutest.min.hpp)" | |
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@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
lizard: | |
runs-on: ubuntu-latest | |
needs: login | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lizard | |
uses: docker://srzzumix/lizard | |
with: | |
args: -o lizard.html --html ./include | |
- name: Archive code metrics results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lizard.html | |
path: lizard.html | |