name: PR Check on: pull_request: branches: [ master ] types: [opened, synchronize, reopened, ready_for_review] jobs: pr-validation: if: github.event.pull_request.draft == false 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-matrix: if: github.event.pull_request.draft == false runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: pnpm: [9.15.5] os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Checkout uses: actions/checkout@v4 - name: Test action uses: ./ with: version: ${{ matrix.pnpm }} - name: Verify installation run: | which pnpm pnpm --version - name: Test install functionality run: pnpm install security-check: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup pnpm uses: ./ with: version: 9 - name: Security audit run: pnpm audit --audit-level moderate lint-and-format: if: github.event.pull_request.draft == false 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: Check TypeScript run: npx tsc --noEmit - name: Verify action.yml syntax run: | if ! command -v yq &> /dev/null; then sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 sudo chmod +x /usr/local/bin/yq fi yq eval action.yml > /dev/null all-checks: if: github.event.pull_request.draft == false needs: [pr-validation, test-matrix, security-check, lint-and-format] runs-on: ubuntu-latest steps: - name: All checks passed run: echo "✅ All PR checks passed successfully"