Skip to content

prettierignore husky dir #11

prettierignore husky dir

prettierignore husky dir #11

Workflow file for this run

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: "Checks"
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency: checks-${{ github.ref == 'refs/heads/main' && 'main' || github.event.pull_request.head.sha }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-node@v4.0.1
with:
node-version-file: "package.json"
cache: "npm"
- id: node-modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- if: steps.node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- run: npm run build
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4.0.1
with:
node-version-file: "package.json"
cache: "npm"
- id: node-modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- if: steps.node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- run: npm ls --package-lock-only
- uses: actions/cache@v3
with:
path: node_modules/.cache/prettier/.prettier-cache
key: prettier-${{ github.run_id }}
restore-keys: |
prettier-
- run: npm run lint
- run: |
if [[ $(git status --porcelain) != "" ]]; then
git --no-pager diff --color --text HEAD
exit 1
fi
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4.0.1
with:
node-version-file: "package.json"
cache: "npm"
- id: node-modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- if: steps.node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- run: npm ls --package-lock-only
- id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v2
- run: |
JEST_CACHE_DIRECTORY=$(npx jest --color --showConfig | jq --raw-output ".configs[0].cacheDirectory")
echo "JEST_CACHE_DIRECTORY=$JEST_CACHE_DIRECTORY" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ${{ env.JEST_CACHE_DIRECTORY }}
key: jest-${{ github.run_id }}
restore-keys: |
jest-
- run: npm test