Skip to content

chore: cache bun dependencies #3

chore: cache bun dependencies

chore: cache bun dependencies #3

Workflow file for this run

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 }}