Skip to content

chore: Release packages 🏷️ #1290

chore: Release packages 🏷️

chore: Release packages 🏷️ #1290

Workflow file for this run

name: CI - PR
on:
pull_request:
branches:
- main
- develop
paths-ignore:
- .github/workflows/pull_request_examples.yml
- examples/**
push:
branches:
- main
- develop
paths-ignore:
- .github/workflows/pull_request_examples.yml
- examples/**
# TODO: Remove and replace with real matrix.
workflow_dispatch:
inputs:
NODE_VERSIONS:
description: 'Node versions to test against. Need a JSON array of versions.'
required: true
default: '[22]'
type: string
permissions:
contents: read
jobs:
generate_schema:
uses: './.github/workflows/generate-schema.yml'
name: Generate WPGraphQL schema
with:
# TODO: Get from PR description.
ref: 'develop'
secrets: inherit
eslint:
name: ESLint
runs-on: ubuntu-latest
env:
GRAPHQL_SCHEMA_FILE: '${{ github.workspace }}/schema.graphql'
needs: generate_schema
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Get generated schema
uses: actions/download-artifact@v8
with:
name: schema
path: /tmp/schema
- name: Move schema to workspace
run: |
cp /tmp/schema/schema.graphql ${{ github.workspace }}/schema.graphql
- name: Install dependencies
run: |
npm ci --workspaces --include-workspace-root
ls -al node_modules
ls -al node_modules/@snapwp
npm run --if-present build
- name: Run ESLint
run: npm run --if-present lint
typecheck:
name: TS Typecheck
runs-on: ubuntu-latest
env:
GRAPHQL_SCHEMA_FILE: '${{ github.workspace }}/schema.graphql'
needs: generate_schema
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Get generated schema
uses: actions/download-artifact@v8
with:
name: schema
path: /tmp/schema
- name: Move schema to workspace
run: |
cp /tmp/schema/schema.graphql ${{ github.workspace }}/schema.graphql
- name: Install dependencies
run: npm ci --workspaces --include-workspace-root
- name: Build assets
run: npm run --if-present build
- name: Run TypeScript type check
run: npm run --if-present typecheck
test-build:
name: Test Build (Node v${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ${{ fromJSON('[22]') }}
fail-fast: true
env:
GRAPHQL_SCHEMA_FILE: '${{ github.workspace }}/schema.graphql'
needs: generate_schema
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Get generated schema
uses: actions/download-artifact@v8
with:
name: schema
path: /tmp/schema
- name: Move schema to workspace
run: |
cp /tmp/schema/schema.graphql ${{ github.workspace }}/schema.graphql
- name: Install dependencies
run: npm ci --workspaces --include-workspace-root
- name: Build assets
run: npm run --if-present build
unit:
name: Unit Tests (Node v${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ${{ fromJSON('[22]') }}
fail-fast: true
env:
GRAPHQL_SCHEMA_FILE: '${{ github.workspace }}/schema.graphql'
needs: generate_schema
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Get generated schema
uses: actions/download-artifact@v8
with:
name: schema
path: /tmp/schema
- name: Move schema to workspace
run: |
cp /tmp/schema/schema.graphql ${{ github.workspace }}/schema.graphql
- name: Install dependencies
run: npm ci --workspaces --include-workspace-root
- name: Run unit tests
run: npm run --if-present test:unit:coverage-collect
- name: Push coverage to Coveralls.io
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/lcov.info
flag-name: Unit
format: lcov
# Reenable when we have playwright tests
# playwright:
# name: E2E Tests (Node v${{ matrix.node-version }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: ${{ fromJSON('[22]') }}
# fail-fast: true
# steps:
# - name: Checkout
# uses: actions/checkout@v6
# - name: Setup Node.js
# uses: actions/setup-node@v6
# with:
# node-version: ${{ matrix.node-version }}
# - name: Install dependencies
# run: npm ci --workspaces --include-workspace-root
# - name: Install and setup playwright
# run: |
# npm install playwright
# npx playwright install --with-deps
# - name: Run E2E tests
# run: npm run --if-present test:e2e
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: playwright-results
# path: playwright-report/
# retention-days: 3 # TODO: Figure this number out
prettier:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci --workspaces --include-workspace-root
- name: Run Prettier
run: npm run --if-present format:check