Files
payload/.github/workflows/tests.yml
2023-09-01 16:59:45 +02:00

75 lines
2.0 KiB
YAML

name: build
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: ['master', '2.0']
jobs:
install_and_build_pnpm:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
scope: '@payloadcms'
always-auth: true
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Debug print versions
run: |
node -v
pnpm -v
- name: Install dependencies
run: pnpm install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm --filter payload build
- name: Component Tests
run: pnpm --filter payload run test:components
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: E2E Tests
run: pnpm --filter payload test:e2e --bail
- name: Integration Tests
run: pnpm --filter payload run test:int
- name: Generate Payload Types
run: pnpm dev:generate-types fields
- name: Generate GraphQL schema file
run: pnpm dev:generate-graphql-schema graphql-schema-gen
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 30