-
Notifications
You must be signed in to change notification settings - Fork 3
112 lines (96 loc) · 3.35 KB
/
checkerframework.yml
File metadata and controls
112 lines (96 loc) · 3.35 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Checker Framework
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: write
jobs:
nullness:
runs-on: ubuntu-latest
timeout-minutes: 30
name: Nullness Checker
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Create plugin dirs
run: |
mkdir -p ~/vstar_plugins
mkdir -p ~/vstar_plugin_libs
- name: Run Checker Framework Nullness Checker
run: ant -noinput -buildfile build.xml checker
- name: Extract warning counts
if: always()
id: cf-warnings
run: |
REPORT="test_report/checkerframework/checker-report.txt"
if [ -f "$REPORT" ]; then
TOTAL=$(grep -c 'warning:' "$REPORT" || true)
NULLNESS=$(grep -c '\[nullness\]\|dereference.of.nullable\|argument\]\|assignment\]\|return\]' "$REPORT" || true)
INIT=$(grep -c '\[initialization' "$REPORT" || true)
echo "found=true" >> "$GITHUB_OUTPUT"
echo "total=$TOTAL" >> "$GITHUB_OUTPUT"
echo "nullness=$NULLNESS" >> "$GITHUB_OUTPUT"
echo "init=$INIT" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
fi
- name: Post step summary
if: always() && steps.cf-warnings.outputs.found == 'true'
run: |
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
## Checker Framework Nullness Analysis
| Metric | Count |
|--------|-------|
| **Total warnings** | **${{ steps.cf-warnings.outputs.total }}** |
| Nullness warnings | ${{ steps.cf-warnings.outputs.nullness }} |
| Initialization warnings | ${{ steps.cf-warnings.outputs.init }} |
Download the **checker-framework-report** artifact for the full report.
EOF
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: checker-framework-report
path: test_report/checkerframework/checker-report.txt
- name: Checkout gh-pages
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
steps.cf-warnings.outputs.found == 'true'
uses: actions/checkout@v4
with:
ref: gh-pages
path: _site
- name: Publish to dashboard
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
steps.cf-warnings.outputs.found == 'true'
run: |
DATE=$(date -u +%Y-%m-%d)
mkdir -p _site/health/data
cat > _site/health/data/checker.json <<DATAJSON
{
"updated": "${DATE}",
"total": ${{ steps.cf-warnings.outputs.total }},
"nullness": ${{ steps.cf-warnings.outputs.nullness }},
"init": ${{ steps.cf-warnings.outputs.init }}
}
DATAJSON
cd _site
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -A
git diff --cached --quiet && exit 0
git commit -m "Update Checker Framework data [${DATE}]"
for i in 1 2 3; do
git pull --rebase origin gh-pages && git push origin gh-pages && break
echo "Push attempt $i failed, retrying in $((i * 5))s..."
sleep $((i * 5))
done