lint-code.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: "Lint Code"
  2. on:
  3. push:
  4. branches: [main, develop]
  5. pull_request:
  6. branches: [main, develop]
  7. jobs:
  8. lint:
  9. name: Lint Code
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. node-version: [22.x]
  14. env:
  15. CI: "true"
  16. STORE_PATH: ""
  17. PNPM_VERSION: 9
  18. RETENTION_DAYS: 2
  19. steps:
  20. - name: Checkout code
  21. uses: actions/checkout@v4
  22. - name: Setup Node.js v${{ matrix.node-version }}
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: ${{ matrix.node-version }}
  26. - name: Setup pnpm
  27. uses: pnpm/action-setup@v4
  28. with:
  29. version: ${{ env.PNPM_VERSION }}
  30. run_install: false
  31. - name: Get pnpm store directory
  32. shell: bash
  33. run: |
  34. echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
  35. - name: Setup pnpm cache
  36. uses: actions/cache@v4
  37. with:
  38. path: ${{ env.STORE_PATH }}
  39. key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  40. restore-keys: |
  41. ${{ runner.os }}-pnpm-store-
  42. - name: Install dependencies
  43. run: pnpm i
  44. - name: Lint
  45. run: npm run lint