File: format.yml

package info (click to toggle)
cppcheck 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,924 kB
  • sloc: cpp: 274,396; python: 22,429; ansic: 8,103; sh: 1,094; makefile: 1,041; xml: 987; cs: 291
file content (55 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: format

on:
  push:
    branches:
      - 'main'
      - 'releases/**'
      - '2.*'
    tags:
      - '2.*'
  pull_request:

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-22.04

    env:
      UNCRUSTIFY_VERSION: 0.80.1

    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: Cache uncrustify
        uses: actions/cache@v4
        id: cache-uncrustify
        with:
          path: |
            ~/uncrustify
          key: ${{ runner.os }}-uncrustify-${{ env.UNCRUSTIFY_VERSION }}

      - name: build uncrustify
        if: steps.cache-uncrustify.outputs.cache-hit != 'true'
        run: |
          set -x
          wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz
          tar xzvf uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz
          cd uncrustify-uncrustify-${{ env.UNCRUSTIFY_VERSION }}
          cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
          cmake --build build -- -j$(nproc) -s
          mkdir ~/uncrustify 
          cp build/uncrustify ~/uncrustify/

      - name: Uncrustify check
        run: |
          UNCRUSTIFY=~/uncrustify/uncrustify ./runformat
          git diff
          git diff | diff - /dev/null &> /dev/null