Skip to content

megamoe

megamoe #17197

Workflow file for this run

name: Checks
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
check-ck:
name: Check Repository Dependency
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Verify 3rdparty commits
if: github.ref != 'refs/heads/main'
run: ./.github/scripts/check_deps.sh
- name: Skip check on main branch
if: github.ref == 'refs/heads/main'
run: echo "Skipping dependency check on main branch, considered success."
black:
name: Check Code Style with Black
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Black
uses: psf/black@stable
ruff:
name: Check Code Style with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
# Pinned on purpose. Unpinned, a ruff release that widens the default
# rule set turns unrelated PRs red with no change on our side (0.16.0
# did exactly that). Bump this deliberately, with the resulting
# findings burned down in the same or a follow-up PR.
run: pip3 install ruff==0.16.0
- name: Install reviewdog
uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893
- name: Run ruff with reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REVIEWDOG_REPORTER: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
REVIEWDOG_FILTER_MODE: ${{ github.event_name == 'pull_request' && 'diff_context' || 'nofilter' }}
run: |
ruff check . \
--output-format=rdjson \
--exit-zero \
--no-fix \
| reviewdog \
-f=rdjson \
-name="ruff" \
-reporter="${REVIEWDOG_REPORTER}" \
-filter-mode="${REVIEWDOG_FILTER_MODE}" \
-fail-on-error=true