|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +name: Code Quality |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | + |
| 6 | +permissions: read-all |
| 7 | + |
| 8 | +jobs: |
| 9 | + lint: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: read |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 15 | + |
| 16 | + - name: Check file permissions |
| 17 | + run: | |
| 18 | + find . -type f -perm /111 -name "*.sh" | head -10 || true |
| 19 | + |
| 20 | + - name: Check for secrets |
| 21 | + uses: trufflesecurity/trufflehog@116e7171542d2f1dad8810f00dcfacbe0b809183 # v3.92.5 |
| 22 | + with: |
| 23 | + path: ./ |
| 24 | + base: ${{ github.event.pull_request.base.sha || github.event.before }} |
| 25 | + head: ${{ github.sha }} |
| 26 | + continue-on-error: true |
| 27 | + |
| 28 | + - name: Check TODO/FIXME |
| 29 | + run: | |
| 30 | + echo "=== TODOs ===" |
| 31 | + grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" --include="*.res" --include="*.py" --include="*.ex" . | head -20 || echo "None found" |
| 32 | + |
| 33 | + - name: Check for large files |
| 34 | + run: | |
| 35 | + find . -type f -size +1M -not -path "./.git/*" | head -10 || echo "No large files" |
| 36 | + |
| 37 | + - name: EditorConfig check |
| 38 | + uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 # v2.1.0 |
| 39 | + continue-on-error: true |
| 40 | + |
| 41 | + docs: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 47 | + - name: Check documentation |
| 48 | + run: | |
| 49 | + MISSING="" |
| 50 | + [ ! -f "README.md" ] && [ ! -f "README.adoc" ] && MISSING="$MISSING README" |
| 51 | + [ ! -f "LICENSE" ] && [ ! -f "LICENSE.txt" ] && [ ! -f "LICENSE.md" ] && MISSING="$MISSING LICENSE" |
| 52 | + [ ! -f "CONTRIBUTING.md" ] && [ ! -f "CONTRIBUTING.adoc" ] && MISSING="$MISSING CONTRIBUTING" |
| 53 | + |
| 54 | + if [ -n "$MISSING" ]; then |
| 55 | + echo "::warning::Missing docs:$MISSING" |
| 56 | + else |
| 57 | + echo "✅ Core documentation present" |
| 58 | + fi |
0 commit comments