|
| 1 | +name: Lint |
| 2 | + |
| 3 | +concurrency: |
| 4 | + group: lint-${{ github.ref }} |
| 5 | + cancel-in-progress: true |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + types: [opened, synchronize, reopened] |
| 10 | + paths: |
| 11 | + - "server/**/*.js" |
| 12 | + - "server/eslint.config.mjs" |
| 13 | + - "collector/**/*.js" |
| 14 | + - "collector/eslint.config.mjs" |
| 15 | + - "frontend/src/**/*.js" |
| 16 | + - "frontend/src/**/*.jsx" |
| 17 | + - "frontend/eslint.config.js" |
| 18 | + |
| 19 | +jobs: |
| 20 | + lint: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Set up Node.js |
| 28 | + uses: actions/setup-node@v4 |
| 29 | + with: |
| 30 | + node-version: "18" |
| 31 | + |
| 32 | + - name: Cache server dependencies |
| 33 | + uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + path: server/node_modules |
| 36 | + key: ${{ runner.os }}-yarn-server-${{ hashFiles('server/yarn.lock') }} |
| 37 | + restore-keys: | |
| 38 | + ${{ runner.os }}-yarn-server- |
| 39 | +
|
| 40 | + - name: Cache frontend dependencies |
| 41 | + uses: actions/cache@v4 |
| 42 | + with: |
| 43 | + path: frontend/node_modules |
| 44 | + key: ${{ runner.os }}-yarn-frontend-${{ hashFiles('frontend/yarn.lock') }} |
| 45 | + restore-keys: | |
| 46 | + ${{ runner.os }}-yarn-frontend- |
| 47 | +
|
| 48 | + - name: Cache collector dependencies |
| 49 | + uses: actions/cache@v4 |
| 50 | + with: |
| 51 | + path: collector/node_modules |
| 52 | + key: ${{ runner.os }}-yarn-collector-${{ hashFiles('collector/yarn.lock') }} |
| 53 | + restore-keys: | |
| 54 | + ${{ runner.os }}-yarn-collector- |
| 55 | +
|
| 56 | + - name: Install server dependencies |
| 57 | + run: cd server && yarn install --frozen-lockfile |
| 58 | + |
| 59 | + - name: Install frontend dependencies |
| 60 | + run: cd frontend && yarn install --frozen-lockfile |
| 61 | + |
| 62 | + - name: Install collector dependencies |
| 63 | + run: cd collector && yarn install --frozen-lockfile |
| 64 | + |
| 65 | + - name: Lint server |
| 66 | + run: cd server && yarn lint:check |
| 67 | + |
| 68 | + - name: Lint frontend |
| 69 | + run: cd frontend && yarn lint:check |
| 70 | + |
| 71 | + - name: Lint collector |
| 72 | + run: cd collector && yarn lint:check |
0 commit comments