feat: make compilation database search more robust #770
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: format | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| pixi-version: v0.61.0 | |
| environments: develop | |
| activate-environment: true | |
| cache: true | |
| locked: true | |
| - name: Run check | |
| id: precommit | |
| run: | | |
| pixi run ci-check | |
| continue-on-error: true | |
| - name: Show diff on failure | |
| if: steps.precommit.outcome == 'failure' | |
| run: | | |
| echo "❌ pre-commit found issues that it auto-fixed." | |
| echo " Please run 'pre-commit run --all-files' locally," | |
| echo " commit the changes, and push again." | |
| echo "" | |
| echo "👇 The required changes are shown below:" | |
| git diff | |
| - name: Fail the job if pre-commit failed | |
| if: steps.precommit.outcome == 'failure' | |
| run: | | |
| echo "pre-commit checks failed." | |
| exit 1 | |
| - name: Auto correct | |
| uses: huacnlee/autocorrect-action@main | |
| with: | |
| args: --lint ./docs |