Setup clang format for C code #8
Workflow file for this run
This file contains hidden or 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: C Code Formatting Check | |
on: | |
push: | |
paths: | |
- '**.c' | |
- '**.h' | |
- '.clang-format' | |
- '.github/workflows/clang-format.yml' | |
pull_request: | |
paths: | |
- '**.c' | |
- '**.h' | |
- '.clang-format' | |
- '.github/workflows/clang-format.yml' | |
jobs: | |
format-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.4" | |
bundler-cache: none | |
- name: Set working directory as safe | |
run: git config --global --add safe.directory $(pwd) | |
- name: Set up permission | |
run: chmod -R o-w /opt/hostedtoolcache/Ruby | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool clang-format | |
- name: Update rubygems & bundler | |
run: | | |
ruby -v | |
gem update --system | |
- name: bin/setup | |
run: | | |
bin/setup | |
- name: Check C code formatting | |
run: bundle exec rake format:c_check |