Skip to content

chore(workflows): add PR checks workflows to run tests and formatter #9

chore(workflows): add PR checks workflows to run tests and formatter

chore(workflows): add PR checks workflows to run tests and formatter #9

Workflow file for this run

name: PR Checks
on:
pull_request:
branches: [main]
jobs:
format-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Copy environment variables to dev apps
run: |
echo "${{ secrets.PAGES_DEV_ENV_FILE }}" > pages/dev/.env
echo "${{ secrets.PAGES_DEV_UNLOCALIZED_ENV_FILE }}" > pages/dev_unlocalized/.env
echo "${{ secrets.PAGES_DEV_MULTI_TENANT_ENV_FILE }}" > pages/dev_multi_tenant/.env
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ^9.0.0
- name: Install dependencies in all packages
run: pnpm install:all
- name: Run format
run: pnpm format:all
- name: Check for formatting changes in all packages
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Code formatting changes detected. Please run 'pnpm format' locally and commit the changes."
git status
git diff
exit 1
fi
- name: Run tests in all packages
run: pnpm test:all