Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/pr_build.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: People Portal PR Checks

on:
pull_request:
branches: ["master"]
paths:
- "peopleportal/**"
- ".nx/**"
- "nx.json"
- "nx"
- ".prettierrc"
- ".prettierignore"
- ".github/workflows/pr_checks.yml"

workflow_dispatch:

concurrency:
group: "pr-checks-${{ github.ref }}"
cancel-in-progress: true

permissions:
contents: read

# The three jobs run in parallel so the PR gets every result as fast as possible.
jobs:
format:
name: Format (Prettier)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20" # Keep in sync with the other jobs and deploy_peopleportal.yml

- name: Check formatting
# Prettier is pinned so a new release cannot change the output underneath us.
# Run `npx prettier@3.9.10 --write peopleportal/webui/src peopleportal/server/src` to fix failures.
run: npx --yes prettier@3.9.10 --check peopleportal/webui/src peopleportal/server/src

build:
name: Build (Nx)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20" # Keep in sync with the other jobs and deploy_peopleportal.yml

- name: Build with Nx
# Same build the deploy workflow runs, so a PR that cannot build fails before it merges
run: ./nx run-many -t build -p pplserver pplui

test:
name: Test (Nx)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
# Node 22, not 20: the server test script passes a glob to `node --test`, which Node 20
# does not expand, and express-handlebars requires Node >=22.15.
node-version: "22"

- name: Run tests
# The test targets depend on the build, so Nx builds first inside this job.
# Integration tests (pplserver:test-integration) are left out: they need Mongo/Redis.
run: |
./nx run pplserver:test-unit
./nx run pplui:test
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Handlebars email templates use partials ({{> header}}), which Prettier's
# glimmer parser cannot handle ("Handlebars partials are not supported").
# The partials themselves (header.hbs, footer.hbs) parse fine, so keep them checked.
peopleportal/server/src/clients/EmailClient/templates/*.hbs
!peopleportal/server/src/clients/EmailClient/templates/header.hbs
!peopleportal/server/src/clients/EmailClient/templates/footer.hbs

# Not formatted with Prettier
landing-v3/

# Generated by `tsoa spec-and-routes` on every build
peopleportal/server/src/routes.ts
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
Loading
Loading