temp(none):add temp code diff to test clang-format in ci #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
BUILD_TYPE: RelWithDebInfo | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Upgrade cmake | |
run: brew upgrade cmake | |
- name: Install wget manually | |
run: brew install wget | |
- name: Install googletest manually | |
run: brew install googletest | |
- name: Install Clang-Format manually | |
run: brew install clang-format | |
- name: Find modified files and format | |
run: | | |
git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep '\.\(cpp\|cc\|h\|hpp\)$' | xargs clang-format -i | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply clang-format | |
branch: ${{ github.head_ref }} | |
file_pattern: '*.cpp *.h *.hpp *.cc' | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_MINISTL_TEST=ON -DCMAKE_CXX_FLAGS="-Werror" | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Run test cases | |
working-directory: ${{github.workspace}}/build/Test | |
run: ./Test |