-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (76 loc) · 2.61 KB
/
daily-report.yml
File metadata and controls
95 lines (76 loc) · 2.61 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Hourly Report Generator
on:
schedule:
# Run every hour at minute 0
- cron: '0 * * * *'
# Allow manual trigger for testing
workflow_dispatch:
jobs:
generate-report:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Full git history for reports
fetch-depth: 0
# Include submodules for artemis folder
submodules: true
# Use PAT instead of GITHUB_TOKEN
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install dependencies
run: npm ci --force
- name: Setup Git identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update artemis submodule
run: |
# Navigate into the artemis submodule directory
cd artemis
# Make sure we're on the main branch (or default branch)
git checkout develop || git checkout main || git checkout master
# Pull the latest changes
git pull
# Go back to the main repo directory
cd ..
- name: Run client-side report
run: |
# Force report to use the current state of artemis
npm run report
# Also generate the relative time report if needed
npm run report -- --relative 2h
- name: Run DTO violations report (static analysis)
run: |
# Full static analysis with JavaParser - no Artemis compilation needed!
# This provides 93% accuracy with full details (files, lines, endpoints)
npm run report:dto
timeout-minutes: 5
- name: Commit changes
run: |
# Add artemis submodule changes
git add artemis
# Add any new report files
git add data/
# Check if there are any changes
if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi
# Commit with current timestamp
git commit -m "chore: update code stats report and artemis submodule for $(date +'%Y-%m-%d %H:%M')"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
branch: ${{ github.ref_name }}