|
1 | | -# @file ci.yml |
2 | | -# @brief Used to perform code format checking and Sonarcloud analysis |
| 1 | +# @file check-code-format.yml |
| 2 | +# @brief Used to perform code format checking |
3 | 3 | # |
4 | 4 | # MIT License |
5 | 5 | # |
|
23 | 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
24 | 24 | # SOFTWARE. |
25 | 25 |
|
26 | | -name: ci |
| 26 | +name: check-code-format |
| 27 | + |
27 | 28 | on: |
28 | 29 | push: |
29 | 30 | branches: |
30 | 31 | - '**' |
31 | 32 | pull_request: |
32 | 33 | types: [opened, synchronize, reopened] |
33 | | - schedule: |
34 | | - - cron: '0 0 1 * *' |
| 34 | + |
35 | 35 | jobs: |
36 | | - check: |
| 36 | + check-code-format: |
37 | 37 | name: Check code format |
38 | 38 | runs-on: ubuntu-24.04 |
39 | 39 | steps: |
40 | | - - uses: actions/checkout@v3 |
41 | | - with: |
42 | | - fetch-depth: 0 |
| 40 | + # Install tools |
43 | 41 | - name: Install tools |
44 | 42 | run: | |
45 | 43 | sudo apt-get install clang-format pcregrep |
| 44 | +
|
| 45 | + # Checkout c-cote |
| 46 | + - name: Checkout c-cote |
| 47 | + uses: actions/checkout@v5 |
| 48 | + with: |
| 49 | + path: c-cote |
| 50 | + |
| 51 | + # Check code format |
46 | 52 | - name: Check headers |
| 53 | + if: ${{ always() }} |
| 54 | + working-directory: c-cote |
47 | 55 | run: | |
48 | 56 | ./.github/workflows/check_headers.sh |
49 | 57 | - name: Check include guards |
| 58 | + if: ${{ always() }} |
| 59 | + working-directory: c-cote |
50 | 60 | run: | |
51 | 61 | ./.github/workflows/check_include_guards.sh |
52 | 62 | - name: Check equivalence tests |
| 63 | + if: ${{ always() }} |
| 64 | + working-directory: c-cote |
53 | 65 | run: | |
54 | 66 | ./.github/workflows/check_equivalence_tests.sh |
55 | 67 | - name: Check code format |
| 68 | + if: ${{ always() }} |
| 69 | + working-directory: c-cote |
56 | 70 | run: | |
57 | 71 | ./.github/workflows/check_code_format.sh |
58 | | - build: |
59 | | - name: SonarCloud analysis |
60 | | - runs-on: ubuntu-24.04 |
61 | | - steps: |
62 | | - - uses: actions/checkout@v3 |
63 | | - with: |
64 | | - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
65 | | - - name: Checkout submodules |
66 | | - run: git submodule update --init --recursive |
67 | | - - name: Install sonar-scanner and build-wrapper |
68 | | - uses: SonarSource/sonarcloud-github-c-cpp@v2 |
69 | | - - name: Run build-wrapper |
70 | | - run: | |
71 | | - build-wrapper-linux-x86-64 --out-dir bw_output ./.github/workflows/build.sh |
72 | | - - name: Run sonar-scanner |
73 | | - env: |
74 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
75 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
76 | | - run: | |
77 | | - sonar-scanner -Dsonar.organization=joelguittet -Dsonar.projectKey=joelguittet_c-cote -Dsonar.inclusions=include/**/*,src/**/* -Dsonar.projectVersion=$(cat VERSION) -Dsonar.cfamily.build-wrapper-output=bw_output |
0 commit comments