1
0
mirror of https://github.com/pnpm/action-setup.git synced 2026-03-01 07:51:02 +08:00
action-setup/.github/workflows/build-and-test.yml

52 lines
1.0 KiB
YAML

name: Build and Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: ./
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check if dist is up to date
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "::error::Distribution files are not up to date. Please run 'pnpm run build' and commit the changes."
exit 1
fi
test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test action
uses: ./
with:
version: 9
- name: Verify installation
run: |
which pnpm
pnpm --version