3 on: [push, pull_request]
7 name: FreeRTOS Kernel Header Checks
12 uses: actions/setup-python@v3
14 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 # There is shared code, hosted by FreeRTOS/FreeRTOS, with deps needed by header checker
17 - name: Checkout FreeRTOS Tools
18 uses: actions/checkout@v3
20 repository: FreeRTOS/FreeRTOS
21 sparse-checkout: '.github'
25 # Checkout user pull request changes
26 - name: Checkout Pull Request
27 uses: actions/checkout@v3
31 # Collect all affected files
32 - name: Collecting changed files
33 uses: lots0logs/gh-action-get-changed-files@2.2.2
35 token: ${{ secrets.GITHUB_TOKEN }}
39 bashPass: \033[32;1mPASSED -
40 bashInfo: \033[33;1mINFO -
41 bashFail: \033[31;1mFAILED -
43 stepName: Check File Headers
44 name: ${{ env.stepName }}
48 echo -e "::group::${{ env.bashInfo }} Install Dependencies ${{ env.bashEnd }}"
50 # Copy the common tools from the FreeRTOS/FreeRTOS repo.
51 mv tools/.github/scripts/common inspect/.github/scripts
53 # Install the necessary python dependencies
54 pip install -r inspect/.github/scripts/common/requirements.txt
57 echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
59 # Use the python script to check the copyright header of modified files.
60 .github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
62 echo -e "::endgroup::"
64 if [ $exitStatus -eq 0 ]; then
65 echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
67 echo -e "${{ env.bashFail }} ${{ env.stepName }} ${{ env.bashEnd }}"