init llama infer #103
This file contains 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: Lint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 10 * * *" | |
jobs: | |
lint: | |
name: Check format and lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dev dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e '.[dev]' | |
- name: Lint the code with ruff | |
run: | | |
ruff check | |
- name: Check formatting with ruff | |
shell: bash | |
run: | | |
git_status=$(git status --porcelain) | |
if [[ $git_status ]]; then | |
echo "Checkout code is not clean" | |
echo "${git_status}" | |
exit 1 | |
fi | |
ruff format | |
git_status=$(git status --porcelain) | |
if [[ $git_status ]]; then | |
git diff | |
echo "ruff recommends the changes above, please manually apply them OR automatically apply the changes " | |
echo "by running `ruff format` to format the following files" | |
echo "${git_status}" | |
exit 1 | |
else | |
echo "PASSED Python format" | |
fi |