14 changed files with 272 additions and 177 deletions
@ -1,52 +1,53 @@ |
|||||
name: Pull Request CI |
name: Pull Request CI |
||||
|
|
||||
on: pull_request |
on: |
||||
|
pull_request: |
||||
|
types: [opened, synchronize, reopened, ready_for_review] |
||||
|
|
||||
permissions: |
permissions: |
||||
contents: write |
contents: read |
||||
packages: write |
|
||||
|
concurrency: |
||||
|
group: pr-${{ github.event.pull_request.number }}-ci |
||||
|
cancel-in-progress: true |
||||
|
|
||||
|
env: |
||||
|
CI: true |
||||
|
|
||||
jobs: |
jobs: |
||||
build-and-package: |
build-and-package: |
||||
runs-on: ubuntu-latest |
runs-on: ubuntu-latest |
||||
|
# Skip for draft PRs; remove this line if you want to run on drafts too |
||||
|
if: ${{ github.event.pull_request.draft == false }} |
||||
|
|
||||
steps: |
steps: |
||||
- name: Checkout code |
- name: Checkout code |
||||
uses: actions/checkout@v4 |
uses: actions/checkout@v4 |
||||
|
|
||||
|
# Node + pnpm with built-in cache |
||||
- name: Setup Node.js |
- name: Setup Node.js |
||||
uses: actions/setup-node@v4 |
uses: actions/setup-node@v4 |
||||
with: |
with: |
||||
node-version: 22 |
node-version: 22 |
||||
|
cache: pnpm |
||||
|
cache-dependency-path: '**/pnpm-lock.yaml' |
||||
|
|
||||
- name: Setup pnpm |
- name: Setup pnpm |
||||
uses: pnpm/action-setup@v4 |
uses: pnpm/action-setup@v4 |
||||
with: |
with: |
||||
version: latest |
version: latest |
||||
|
|
||||
- name: Install Dependencies |
- name: Install dependencies (root) |
||||
# Commands will run from 'packages/web' |
run: pnpm install --frozen-lockfile |
||||
working-directory: packages/web |
|
||||
run: pnpm install |
|
||||
|
|
||||
- name: Cache pnpm dependencies |
|
||||
uses: actions/cache@v4 |
|
||||
with: |
|
||||
path: | |
|
||||
~/.pnpm-store |
|
||||
packages/web/node_modules |
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('packages/web/pnpm-lock.yaml') }} |
|
||||
restore-keys: | |
|
||||
${{ runner.os }}-pnpm- |
|
||||
|
|
||||
- name: Run linter |
- name: Run linter |
||||
run: pnpm run lint |
run: pnpm run lint |
||||
|
|
||||
- name: Check formatter |
- name: Check formatter |
||||
run: pnpm run check |
run: pnpm run check |
||||
|
|
||||
- name: Run tests |
- name: Run tests |
||||
run: pnpm run test |
run: pnpm run test |
||||
|
|
||||
- name: Build Package |
- name: Build web package |
||||
working-directory: packages/web |
run: pnpm --filter "./packages/web" run build |
||||
run: pnpm run build |
|
||||
|
|||||
Loading…
Reference in new issue