This file contains 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: Format and Build Check | |
on: | |
push: | |
branches: | |
- '**' # Triggers on push to any branch | |
pull_request: | |
branches: | |
- '**' # Triggers on pull requests from any branch | |
jobs: | |
format-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 # Replace with your Node.js version | |
cache: 'pnpm' | |
# Step 3: Install pnpm | |
- name: Install pnpm | |
run: npm install -g pnpm | |
env: | |
PATH: /home/runner/.npm-global/bin:${{ env.PATH }} | |
# Step 4: Install dependencies | |
- name: Install dependencies | |
run: pnpm install | |
# Step 5: Run format check | |
- name: Format check | |
run: pnpm run format | |
# Step 6: Run build check | |
- name: Build check | |
run: pnpm run build |