chore: ignore local CodeGraph index #10
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
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
| # | |
| # NOTE: this workflow only VERIFIES that the package is styled. It never | |
| # auto-commits changes. If the check fails, run `styler::style_pkg()` locally | |
| # and commit the reformatted files yourself. | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| name: style | |
| permissions: read-all | |
| # Cancel a superseded run (e.g. a newer push to the same ref) so its minutes | |
| # are not wasted completing. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| style: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::styler, local::. | |
| needs: style | |
| - name: Check styling | |
| run: styler::style_pkg(strict = TRUE) | |
| shell: Rscript {0} | |
| - name: Fail if the package was reformatted | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git diff | |
| echo "The package is not styled. Run `styler::style_pkg(strict = TRUE)` locally and commit the result." | |
| exit 1 | |
| fi |