autotune target_bits example for llama recipe #22
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
| # Copyright (C) 2025 Intel Corporation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Fix Code Style on PR | |
| on: | |
| pull_request: | |
| branches: [master_next, master] | |
| types: [opened, reopened, ready_for_review, synchronize] | |
| # If there is a new commit, the previous jobs will be canceled | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| scan-and-fix: | |
| if: ${{ contains(github.repository, 'intel-innersource') }} | |
| runs-on: ${{ contains(github.repository, 'intel-innersource') && 'self-hosted' || 'ubuntu-latest' }} | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Clean Up Working Directory | |
| run: sudo rm -rf ${{github.workspace}}/* | |
| - name: Checkout Repo | |
| uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fix Code Style | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Create a virtual environment | |
| python -m venv venv | |
| source venv/bin/activate | |
| # Upgrade pip and install pre-commit | |
| pip install --upgrade pip | |
| pip install -U pre-commit | |
| # Run pre-commit hooks to fix auto-fixable issues | |
| pre-commit install | |
| pre-commit run --all-files | tee pre-commit.log 2>&1 || true | |
| # Check if there are changes after pre-commit run | |
| if [ -n "$(git status --porcelain)" ]; then | |
| # Commit and push the changes if there are any | |
| git config user.name "GitHub Action" | |
| git config user.email "[email protected]" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git | |
| git add -A | |
| git commit -n -s -m "chore: apply pre-commit auto-fixes" | |
| git push origin HEAD:${{ github.head_ref }} | |
| else | |
| # If no changes are made, print a message | |
| echo "No auto-fixable changes were made by pre-commit." | |
| fi | |
| sleep 1s | |
| if [ $(grep -c "Failed" pre-commit.log) != 0 ]; then | |
| echo "Some checks failed that require manual intervention. Please review the pre-commit.log for details." | |
| exit 1 | |
| fi |