mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 02:52:39 +08:00
66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: <Native> Linter
|
|
|
|
on: [pull_request]
|
|
# on:
|
|
# pull_request_target
|
|
|
|
jobs:
|
|
# Set the job key. The key is displayed as the job name
|
|
# when a job name is not provided
|
|
super-lint:
|
|
# Name the Job
|
|
name: ClangTidy Android
|
|
# Set the type of machine to run on
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Checks out a copy of your repository on the ubuntu-latest machine
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Python3
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install deps
|
|
run: |
|
|
python -m pip install PyYAML==5.4.1 Cheetah3
|
|
sudo apt install -y ninja-build
|
|
- name: Download external
|
|
run: |
|
|
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
|
|
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external
|
|
|
|
- name: Generate bindings
|
|
shell: bash
|
|
run: |
|
|
python -V
|
|
cd ./native/tools/tojs
|
|
python ./genbindings.py
|
|
rm userconf.ini
|
|
|
|
- name: Generate Compile database
|
|
shell: bash
|
|
run: |
|
|
cd native
|
|
./utils/generate_compile_commands_android.sh
|
|
|
|
- uses: shenxianpeng/cpp-linter-action@v1
|
|
name: Lint action
|
|
id: linter
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
style: file
|
|
version: 11
|
|
thread-comments: false
|
|
ignore: native/cocos/editor-support|native/cocos/bindings/manual|native/cocos/bindings/jswrapper/v8/debugger|native/cocos/audio/android/audio_utils|native/cocos/renderer/gfx-vulkan/volk|native/cocos/bindings/auto
|
|
database: native
|
|
|
|
- name: Fail fast!
|
|
if: steps.linter.outputs.checks-failed > 0
|
|
run: |
|
|
echo "Some files failed the linting checks!"
|
|
exit 1
|