Fix AID star selection persistence across dialog reopen. #42
Workflow file for this run
This file contains hidden or 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: SpotBugs Analysis | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| checks: write | |
| contents: write | |
| jobs: | |
| spotbugs: | |
| runs-on: ubuntu-latest | |
| name: SpotBugs Static Analysis | |
| 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 SpotBugs | |
| run: ant -noinput -buildfile build.xml spotbugs | |
| - name: Extract bug counts | |
| if: always() | |
| id: sb-counts | |
| run: | | |
| XML="test_report/spotbugs/spotbugsXml.xml" | |
| if [ -f "$XML" ]; then | |
| TOTAL=$(grep -c '<BugInstance' "$XML" || true) | |
| HIGH=$(grep -c 'priority="1"' "$XML" || true) | |
| MEDIUM=$(grep -c 'priority="2"' "$XML" || true) | |
| LOW=$(grep -c 'priority="3"' "$XML" || true) | |
| echo "found=true" >> "$GITHUB_OUTPUT" | |
| echo "total=$TOTAL" >> "$GITHUB_OUTPUT" | |
| echo "high=$HIGH" >> "$GITHUB_OUTPUT" | |
| echo "medium=$MEDIUM" >> "$GITHUB_OUTPUT" | |
| echo "low=$LOW" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "found=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Post step summary | |
| if: always() && steps.sb-counts.outputs.found == 'true' | |
| run: | | |
| cat >> "$GITHUB_STEP_SUMMARY" <<EOF | |
| ## SpotBugs Analysis | |
| | Priority | Count | | |
| |----------|-------| | |
| | **Total** | **${{ steps.sb-counts.outputs.total }}** | | |
| | High | ${{ steps.sb-counts.outputs.high }} | | |
| | Medium | ${{ steps.sb-counts.outputs.medium }} | | |
| | Low | ${{ steps.sb-counts.outputs.low }} | | |
| EOF | |
| - name: Upload SpotBugs report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spotbugs-report | |
| path: test_report/spotbugs/ | |
| - name: Annotate PR with SpotBugs findings | |
| if: always() | |
| uses: lcollins/spotbugs-github-action@v3.2.0 | |
| with: | |
| path: '**/spotbugsXml.xml' | |
| fail-on-violation: false | |
| - name: Checkout gh-pages | |
| if: >- | |
| github.event_name == 'push' && | |
| github.ref == 'refs/heads/master' && | |
| steps.sb-counts.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.sb-counts.outputs.found == 'true' | |
| run: | | |
| DATE=$(date -u +%Y-%m-%d) | |
| cat > _site/data/spotbugs.json <<DATAJSON | |
| { | |
| "updated": "${DATE}", | |
| "total": ${{ steps.sb-counts.outputs.total }}, | |
| "high": ${{ steps.sb-counts.outputs.high }}, | |
| "medium": ${{ steps.sb-counts.outputs.medium }}, | |
| "low": ${{ steps.sb-counts.outputs.low }} | |
| } | |
| 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 SpotBugs 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 |