|
| 1 | +name: Lint Check |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - develop |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - develop |
| 12 | + |
| 13 | +jobs: |
| 14 | + lint: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Setup Node.js |
| 22 | + uses: actions/setup-node@v4 |
| 23 | + with: |
| 24 | + node-version: '20' |
| 25 | + cache: 'npm' |
| 26 | + |
| 27 | + - name: Setup Python |
| 28 | + uses: actions/setup-python@v5 |
| 29 | + with: |
| 30 | + python-version: '3.11' |
| 31 | + cache: 'pip' |
| 32 | + |
| 33 | + - name: Setup Java |
| 34 | + uses: actions/setup-java@v4 |
| 35 | + with: |
| 36 | + distribution: 'temurin' |
| 37 | + java-version: '21' |
| 38 | + |
| 39 | + - name: Setup Go |
| 40 | + uses: actions/setup-go@v5 |
| 41 | + with: |
| 42 | + go-version: '1.22' |
| 43 | + |
| 44 | + # Frontend (TypeScript) |
| 45 | + - name: Install frontend dependencies |
| 46 | + working-directory: ./frontend |
| 47 | + run: npm ci |
| 48 | + |
| 49 | + - name: Lint frontend |
| 50 | + working-directory: ./frontend |
| 51 | + run: npm run lint |
| 52 | + |
| 53 | + - name: Type check frontend |
| 54 | + working-directory: ./frontend |
| 55 | + run: npm run type-check |
| 56 | + |
| 57 | + # Backend (Java + Go) |
| 58 | + - name: Lint backend Java |
| 59 | + working-directory: ./backend |
| 60 | + run: | |
| 61 | + if [ -f "pom.xml" ]; then |
| 62 | + mvn checkstyle:check |
| 63 | + elif [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then |
| 64 | + ./gradlew checkstyleMain checkstyleTest |
| 65 | + fi |
| 66 | +
|
| 67 | + - name: Lint backend Go |
| 68 | + working-directory: ./backend |
| 69 | + run: | |
| 70 | + if [ -f "go.mod" ]; then |
| 71 | + go fmt ./... |
| 72 | + go vet ./... |
| 73 | + if ! command -v golangci-lint &> /dev/null; then |
| 74 | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin |
| 75 | + fi |
| 76 | + golangci-lint run |
| 77 | + fi |
| 78 | +
|
| 79 | + # AI (Python) |
| 80 | + - name: Install AI dependencies |
| 81 | + working-directory: ./ai |
| 82 | + run: | |
| 83 | + pip install -r requirements.txt |
| 84 | + pip install flake8 black pylint |
| 85 | +
|
| 86 | + - name: Lint AI (flake8) |
| 87 | + working-directory: ./ai |
| 88 | + run: flake8 . --max-line-length=120 --exclude=venv,__pycache__ |
| 89 | + |
| 90 | + - name: Check AI formatting (black) |
| 91 | + working-directory: ./ai |
| 92 | + run: black --check . |
0 commit comments