Add TestGroups reusable workflow with auto-discovery (#1) #7
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: "Reusable Format PR Workflow" | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| directory: | ||
| description: "The directory on which JuliaFormatter needs to be run" | ||
| default: "." | ||
| required: false | ||
| type: string | ||
| julia-version: | ||
| description: "Julia version" | ||
| default: "1" | ||
| required: false | ||
| type: string | ||
| juliaformatter-version: | ||
| description: "Version of JuliaFormatter to use" | ||
| default: "1" | ||
| required: false | ||
| type: string | ||
| concurrent-jobs: | ||
| description: "Run jobs concurrently" | ||
| default: false | ||
| required: false | ||
| type: boolean | ||
| cancel-in-progress: | ||
| description: "Cancel jobs in-progress in favor of a new one in the same concurrency group" | ||
| default: true | ||
| required: false | ||
| type: boolean | ||
| jobs: | ||
| check-formatting: | ||
| name: "Check Formatting" | ||
| uses: "JuliaActions/workflows/FormatCheck.yml@main" | ||
| with: | ||
| directory: "${{ inputs.directory }}" | ||
| julia-version: "${{ inputs.julia-version }}" | ||
| juliaformatter-version: "${{ inputs.juliaformatter-version }}" | ||
| concurrent-jobs: "${{ inputs.concurrent-jobs }}" | ||
| cancel-in-progress: "${{ inputs.cancel-in-progress }}" | ||
| comment-formatting-suggestions: | ||
| name: "Comment Formatting Suggestions on PR" | ||
| needs: check-formatting | ||
| if: ${{ failure() }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: "Apply formatting changes" | ||
| run: | | ||
| echo "$(cat <<'END_FORMATTING_DIFF' | ||
| ${{ needs.check-formatting.outputs.format-diff-patch }} | ||
| END_FORMATTING_DIFF | ||
| )" | git apply | ||
| - uses: reviewdog/action-suggester@v1 | ||
| with: | ||
| tool_name: JuliaFormatter | ||
| fail_on_error: true | ||
| filter_mode: added | ||