Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved from pnpm to bun #210

Merged
merged 4 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 17 additions & 99 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,135 +1,53 @@
name: 'CI'
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
prettier:
name: Prettier check
runs-on: ubuntu-latest
steps:
- name: Delete previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: '~/.pnpm-store'
key: ${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 8.3.1
run_install: true
- name: Setup
uses: ./gh-actions/setup
- name: Prettier
run: pnpm prettier:check
run: bun run prettier:check

eslint:
name: Eslint
runs-on: ubuntu-latest
steps:
- name: Delete previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: '~/.pnpm-store'
key: ${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 8.3.1
run_install: true
- name: Setup
uses: ./gh-actions/setup
- name: ESLint
run: pnpm lint
run: bun run lint

typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Delete previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: '~/.pnpm-store'
key: ${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 8.3.1
run_install: true
- name: Setup
uses: ./gh-actions/setup
- name: TypeScript
run: pnpm typecheck
run: bun run typecheck
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: Checkout Repo
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 8.3.1
run_install: true
- name: Setup
uses: ./gh-actions/setup
- name: Build
run: pnpm build
# preview:
# name: Deploy preview
# runs-on: ubuntu-latest
# steps:
# - name: Delete previous runs
# uses: styfle/[email protected]
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Cache pnpm modules
# uses: actions/cache@v2
# with:
# path: '~/.pnpm-store'
# key: ${{ runner.os }}-
# - uses: pnpm/[email protected]
# with:
# version: 8.3.1
# run_install: true
# - name: Install Vercel CLI
# run: pnpm install --global vercel@latest
# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
# - name: Build Project Artifacts
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
run: bun run build
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec lint-staged
pnpm run typecheck
bun lint-staged
bun run typecheck
Binary file added bun.lockb
Binary file not shown.
17 changes: 17 additions & 0 deletions gh-actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Setup and install"
description: "Common setup steps for Actions"

runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- shell: bash
run: bun install
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"version": "0.0.0",
"scripts": {
"preinstall": "npx only-allow pnpm",
"preinstall": "npx only-allow bun",
"dev": "nuxt dev",
"build": "nuxt build",
"generate": "nuxt generate",
Expand Down
Loading
Loading