-
Notifications
You must be signed in to change notification settings - Fork 126
86 lines (79 loc) · 2.67 KB
/
clang_tidy.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Clang-tidy
on:
push:
branches:
- clang-tidy
- release
env:
REGION: eu-west-1
jobs:
aws_creds:
name: Get ECR Access
runs-on: [ self-hosted, corefront, sandbox ]
outputs:
token: ${{ steps.ecr_token.outputs.token }}
steps:
- id: ecr_token
name: Get ECR Token
run: |
echo token=$(aws ecr get-login-password --region $REGION) >> $GITHUB_OUTPUT
clang-tidy:
runs-on: [self-hosted, corefront, sandbox]
needs: aws_creds
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-debian11_dev:latest
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
steps:
- name: force chown to avoid errors
run: chown -R $USER:$USER .
- name: Generate github private access token
id: ci-core-app-token
uses: getsentry/[email protected]
with:
app_id: ${{ secrets.CI_CORE_APP_ID }}
private_key: ${{ secrets.CI_CORE_APP_PEM }}
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ steps.ci-core-app-token.outputs.token }}
- name : Install dependencies
run: apt update && apt install -y clang-tools clang-tidy
- name : Clang-tidy Info
run: clang-tidy --version
- name: cmake
working-directory: ${{ runner.temp }}
run: cmake $GITHUB_WORKSPACE/source
- name: Clang-tidy
working-directory: ${{ runner.temp }}
run: make tidy_fix || echo "Files have been tidied ! Let's commit them"
- name: Commit and push changes
# Handle case with no clang-tidy fix
continue-on-error: true
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Clang-tidy the code base
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: '[Clang-Tidy] Code maintenance and modernisation'
body: |
🤖 This is an automatic PR 🤖
Clang-tidy suggests the following changes so far:
- `clang-analyzer-*` : clang Static Analyzer checks.
[#clang-tidy documentation](https://clang.llvm.org/extra/clang-tidy/)
labels: not_in_changelog
team-reviewers: hove-io/coreteam
branch: auto/clang-tidy
base: dev
- name: Check outputs
if: ${{ success() }}
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
- name: clean up workspace
if: ${{ always() }}
run: |
rm -rf ./*
rm -rf ./.??*