Skip to content

Fix/publish workflow #20

Fix/publish workflow

Fix/publish workflow #20

Workflow file for this run

name: PR Checks
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- 'feature/**'
- 'fix/**'
- 'chore/**'
- 'docs/**'
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: 'package/package-lock.json'
- name: Install dependencies
working-directory: ./package
run: npm ci
- name: Run tests
working-directory: ./package
run: npm test
validate:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: 'package/package-lock.json'
- name: Install dependencies
working-directory: ./package
run: npm ci
- name: Format code
id: format
working-directory: ./package
run: npm run format
- name: Commit formatting changes
if: success()
working-directory: ./package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "style: format code" && git push)
- name: Type check
id: type-check
working-directory: ./package
run: npm run type-check || (echo "TypeScript errors found" && exit 1)