chore: cache bun dependencies #3
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: | |
| workflow_call: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "main" | |
| - "dev" | |
| pull_request: | |
| branches: | |
| - "**" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| - name: Get cache key | |
| id: cache-key | |
| run: echo "key=$(sha256sum bun.lockb | cut -d' ' -f1)" >> $GITHUB_OUTPUT | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun | |
| node_modules | |
| key: ${{ runner.os }}-bun-${{ steps.cache-key.outputs.key }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run linters | |
| run: | | |
| bun prettier --check . | |
| bun eslint . | |
| # bun tsc --noEmit | |
| - name: Check commit messages | |
| if: github.event_name == 'pull_request' | |
| run: bun commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.event.pull_request.head.sha }} | |
| - name: Check commit messages (branch push) | |
| if: github.event_name == 'push' | |
| run: bun commitlint --from=${{ github.event.before }} --to=${{ github.event.after }} |