diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 262c318..5543fd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,66 +3,36 @@ name: CI on: [push, pull_request] jobs: - format: - name: Format + prebuild: + name: Pre-Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-modules-${{ hashFiles('bun.lockb') }} - - run: bun i - - run: bun run format - lint: - name: Lint - runs-on: ubuntu-latest - needs: format - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 + - name: Initialize Bun + uses: oven-sh/setup-bun@v1 with: bun-version: latest - - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-modules-${{ hashFiles('bun.lockb') }} - - run: bun i - - run: bun run lint - typecheck: - name: Typecheck - runs-on: ubuntu-latest - needs: lint - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - uses: actions/cache@v4 + - name: Cache Node Modules + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-modules-${{ hashFiles('bun.lockb') }} - - run: bun i - - run: bun run typecheck - commit-message: - name: Commit Message - runs-on: ubuntu-latest - needs: typecheck - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: bun i - - run: bunx commitlint --from HEAD~1 --to HEAD --verbose + - name: Install Packages + run: bun i + + - name: Format + run: bun run format + + - name: Lint Code + run: bun run lint + + - name: Check Types + run: bun run typecheck + + - name: Verify Commit + run: bunx commitlint --from HEAD~1 --to HEAD --verbose diff --git a/notes.md b/notes.md index ca4bd03..c4d086f 100644 --- a/notes.md +++ b/notes.md @@ -36,3 +36,7 @@ 7. **Utilize a Lockfile**: - **How**: Ensure you have a lockfile (`bun.lockb`) committed to your repository to maintain consistent dependency versions across builds. + +- Potentially combine workflow jobs into steps +- Maybe build in workflow and pass to Vercel, or vice versa +- Maybe opt for disabling a workflow if ran locally