Skip to content

Add CI (PAN-15152)

Add CI (PAN-15152) #4

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 18
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 18
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
readmes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 18
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: npm ci
- name: Generate readmes
run: npm run generate-readmes
- name: Check that READMEs are up to date
run: |
changed_files=$(git status -s -- '**/README.md' | cut -c4-)
if [[ -n "$changed_files" ]]; then
echo "Changes detected in `README.md` files:"
echo "$changed_files"
echo "Run `npm run generate-readmes` to update them."
exit 1
fi