75 lines
2.0 KiB
YAML
Raw Normal View History

name: Lint
on:
push: {}
pull_request:
types:
- opened
- synchronize
- ready_for_review
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
2022-09-03 13:41:25 +05:30
- uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request' }}
with:
fetch-depth: 2
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request' }}
with:
fetch-depth: 2
2022-09-03 13:41:25 +05:30
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json
2022-09-03 13:41:25 +05:30
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
2022-09-03 13:41:25 +05:30
node-version: ${{ matrix.node-version }}
- name: Install Packages
run: |
pnpm install --frozen-lockfile
2022-09-03 13:41:25 +05:30
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
- name: Run Linting
run: pnpm run lint
2022-09-03 13:41:25 +05:30
- name: Run changed-files using the fork point of a pull request
id: changed-files-fork-point
uses: tj-actions/changed-files@v29
with:
use_fork_point: 'true'
files: |
2022-10-03 11:55:33 +08:00
packages/mermaid/src/docs/*
- name: Run step if any file(s) in the docs folder change
if: steps.changed-files-fork-point.outputs.only_modified == 'true'
run: |
echo "Only files in the src/docs folder has changed."
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
yarn docs:build
- name: Commit changes
uses: EndBug/add-and-commit@v9
if: steps.changed-files-fork-point.outputs.only_modified == 'true'
with:
message: 'Update docs'
2022-10-03 11:55:33 +08:00
add: 'packages/mermaid/docs/*'
2022-09-03 13:41:25 +05:30
- name: Verify Docs
run: pnpm run docs:verify