Merge pull request #211 from javaevolved/copilot/timer-task-to-schedu… #65
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: Proof Scripts | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'proof/**' | |
| pull_request: | |
| paths: | |
| - 'proof/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| proof: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v6 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - uses: jbangdev/setup-jbang@main | |
| - name: Run proof scripts | |
| shell: bash | |
| run: | | |
| passed=0 | |
| failed=0 | |
| failures=() | |
| scripts=() | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| while IFS= read -r -d '' script; do | |
| [[ "$script" == *.java ]] && scripts+=("$script") | |
| done < <(git diff --name-only --diff-filter=ACMR -z \ | |
| "${{ github.event.pull_request.base.sha }}" \ | |
| "${{ github.event.pull_request.head.sha }}" -- proof/) | |
| else | |
| while IFS= read -r -d '' script; do | |
| scripts+=("$script") | |
| done < <(find proof -name '*.java' -print0 | sort -z) | |
| fi | |
| for script in "${scripts[@]}"; do | |
| name="${script#proof/}" | |
| if jbang "$script" > /dev/null 2>&1; then | |
| echo "✅ $name" | |
| passed=$((passed + 1)) | |
| else | |
| echo "❌ $name" | |
| failures+=("$name") | |
| failed=$((failed + 1)) | |
| fi | |
| done | |
| echo "" | |
| echo "Results: $passed passed, $failed failed out of $((passed + failed)) scripts" | |
| if [ ${#failures[@]} -gt 0 ]; then | |
| echo "" | |
| echo "Failed scripts:" | |
| for f in "${failures[@]}"; do | |
| echo " - $f" | |
| done | |
| exit 1 | |
| fi |