fix(ci): handle dependency updates and resolve all lint warnings #308
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| push: | |
| branches: [exe, Dev] | |
| pull_request: | |
| branches: [exe, Dev] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Run Linter & Build Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref || github.ref }} | |
| - name: Set up Node.js and cache npm dependencies | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Cache TypeScript Build Info | |
| uses: actions/cache@v5 | |
| with: | |
| path: tsconfig.tsbuildinfo | |
| key: ${{ runner.os }}-tsbuildinfo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-tsbuildinfo- | |
| - name: Auto-fix Linting and Formatting | |
| run: | | |
| npm run lint:fix | |
| - name: Commit changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| if [[ `git status --porcelain` ]]; then | |
| git add . | |
| git commit -m "style: auto-fix linting and formatting" | |
| git push origin HEAD:${{ github.head_ref || github.ref_name }} | |
| fi | |
| - name: Run Full Lint Check | |
| run: npm run lint | |
| - name: Verify Build | |
| run: npm run build | |
| - name: Run Tests | |
| run: npm test |