goldendict-ng/.github/workflows/auto format.yml

62 lines
1.8 KiB
YAML
Raw Normal View History

name: autofix.ci
on:
pull_request:
branches:
# - dev
# - master
- staged
paths-ignore:
- "docs/**"
# - ".github/**"
- "howto/**"
- "*.md"
- "locale/**"
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
2023-05-20 05:19:23 +00:00
- uses: actions/checkout@v3.5.2
with:
# check out HEAD on the branch
ref: ${{ github.head_ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
# make sure the parent commit is grabbed as well, because
# that's what will get formatted (i.e. the most recent commit)
fetch-depth: 2
# format the latest commit
- name: ubuntu install clang-format
# if: ${{ github.event.pull_request.head.repo.full_name == 'xiaoyifang/goldendict-ng' }}
id: clang-format
run: |
2023-05-16 12:34:28 +00:00
sudo apt-get install git lsb-release wget software-properties-common
wget -qO - https://apt.llvm.org/llvm.sh| sudo bash
2023-05-16 12:34:28 +00:00
sudo apt-get update
sudo apt-get install -y clang-format
git-clang-format --style=file HEAD^
- uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0
css-js-html-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: |
npm ci
- run: npx prettier --write src/stylesheets src/scripts/gd-*.js
# Optimize all PNGs with https://pngquant.org/
# - run: sudo apt-get update && sudo apt-get install -y pngquant
# - name: Run pngquant
# run: |
# shopt -s globstar
# pngquant -f --ext .png --skip-if-larger -- **/*.png
- uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0