name: rocprofiler-compute Formatting on: push: branches: - develop paths: - 'projects/rocprofiler-compute/**' pull_request: paths: - '.github/workflows/rocprofiler-compute-formatting.yml' - 'projects/rocprofiler-compute/**' - '!**/*.md' - '!**/*.rtf' - '!**/*.rst' - '!**/.markdownlint-ci2.yaml' - '!**/.readthedocs.yaml' - '!**/.spellcheck.local.yaml' - '!**/.wordlist.txt' - '!docs/**' - '!projects/*/docs/**' permissions: contents: read concurrency: # PRs: group by PR number so a new commit cancels in-flight runs. # Pushes: group by SHA so postsubmit runs never cancel each other. group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: true jobs: pre-commit: runs-on: ubuntu-24.04 env: # PRs diff against the base branch; pushes diff against the pre-push tip. FROM_REF: ${{ github.event.pull_request.base.ref && format('origin/{0}', github.event.pull_request.base.ref) || github.event.before }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 # required for --from-ref/--to-ref submodules: recursive - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 with: # Use the rocprofiler-compute project pre-commit config and only check # files changed in this push/PR. extra_args: >- --config projects/rocprofiler-compute/.pre-commit-config.yaml --from-ref ${{ env.FROM_REF }} --to-ref HEAD