Skip to content

Lint & Format

Lint & Format #88

Workflow file for this run

name: Lint & Format
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
concurrency:
group: lint
cancel-in-progress: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Git
run: |
echo '${{ github.token }}' | gh auth login --with-token
gh auth status
gh auth setup-git
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: package.json
check-latest: true
#cache: yarn
package-manager-cache: false
- name: Setup yarn
run: |
corepack enable
yarn set version stable
- name: Get yarn cachedir
id: yarn-cachedir
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Cache yarn
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cachedir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies (yarn)
run: yarn install
- name: Cache apt
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang-format-19 clang-tidy-19
execute_install_scripts: true
- name: Cpp Lint (clang-format & clang-tidy)
uses: cpp-linter/cpp-linter-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
style: file
thread-comments: update
version: 19
files-changed-only: false
continue-on-error: true
- name: ESLint (+vue +prettier +ts)
run: yarn run eslint --fix --ignore-pattern .gitignore
continue-on-error: true
- name: Prettier
run: yarn run prettier --write .
continue-on-error: true
- name: Markdown Lint
uses: DavidAnson/markdownlint-cli2-action@v20
with:
globs: "**/*.{md,markdown};!node_modules"
fix: true
separator: ";"
continue-on-error: true
- name: Autocorrect Fix
uses: huacnlee/autocorrect-action@v2
with:
use_npm: true
args: --fix
continue-on-error: true
- name: Create PullRequest
env:
lint_branch: lint/${{ github.sha }}
run: |
git switch -C $lint_branch
git commit -a --fixup=${{ github.sha }}
git push -f origin $lint_branch
gh pr create --fill-verbose -t lint:${{ github.ref }} -B main -H $lint_branch
continue-on-error: true