ci: add ci workflow #2
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: .github/app | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Set up pnpm (optional if you already have pnpm in your environment) | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.15.2 # Adjust version as needed | |
# Cache the pnpm store | |
- name: Cache pnpm store | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
# Install deps using pnpm | |
- name: Install dependencies | |
run: pnpm install | |
# Upload node_modules as artifact so other jobs can use it | |
- name: Upload node_modules artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: node_modules | |
path: node_modules | |
build: | |
needs: [install] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: .github/app | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download node_modules artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: node_modules | |
path: node_modules | |
- name: Run build | |
run: pnpm build | |
lint: | |
needs: [install] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: .github/app | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download node_modules artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: node_modules | |
path: node_modules | |
- name: Lint code | |
run: pnpm lint |