summaryrefslogtreecommitdiff
path: root/.github/workflows/format_check.yml
blob: 9d7983b1595032c3a30fb978ae6747099d5f0265 (plain)
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
name: Check File Format and License

on:
  pull_request:
    branches:
      - master
    paths-ignore:
      - documentation/**
      - '**/README.md'
      - '**/README_zh.md'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  scancode_job:
    runs-on: ubuntu-22.04
    name: Scan code format and license
    if: github.repository_owner == 'RT-Thread'
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: 3.8

      - name: Install clang-format
        shell: bash
        run: |
          python -m pip install clang-format
          clang-format --version

      - name: Check clang-format
        shell: bash
        run: |
          python tools/ci/clang_format_check.py --repo 'https://github.com/RT-Thread/rt-thread' --branch 'master'

  # # Post CI status to PR comment
  # post-ci-status:
  #   needs: scancode_job
  #   if: always() && github.event_name == 'pull_request' && github.repository_owner == 'RT-Thread'
  #   uses: ./.github/workflows/post_ci_status.yml
  #   with:
  #     workflow_name: "Check File Format and License"
  #     workflow_status: ${{ needs.scancode_job.result }}
  #     pr_number: ${{ github.event.pull_request.number }}
  #   permissions:
  #     pull-requests: write
  #     issues: write