Revert OTA hack #8
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: ClangFormat | |
on: | |
pull_request: | |
paths: | |
- "**.c" | |
- "**.h" | |
jobs: | |
ncs: | |
name: Determine NCS version | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- uses: actions/cache@v3 | |
name: Cache dependencies | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci | |
- name: Get NCS version | |
id: version | |
run: echo "version=`node .github/ncs-version.mjs`" >> $GITHUB_OUTPUT | |
clang-format: | |
runs-on: ubuntu-22.04 | |
needs: [ncs] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install run-clang-format.py | |
run: | | |
curl -s https://raw.githubusercontent.com/Sarcasm/run-clang-format/50a5250a2666218595ee21d68c71f50ac39866d2/run-clang-format.py > run-clang-format.py | |
chmod +x run-clang-format.py | |
- name: Run ClangFormat | |
# In NCS there is no formatting enforced, therefore we ignore errors here. | |
# This action then serves as reference how to use it in CI. | |
continue-on-error: true | |
run: | | |
clang-format --version | |
curl -s https://raw.githubusercontent.com/nrfconnect/sdk-nrf/${{ needs.ncs.outputs.version }}/.clang-format > .clang-format | |
./run-clang-format.py -r src |