Skip to content

Commit a936a1b

Browse files
authored
Kernel Checker CI Workflow File Updates (#804)
* Perform sparse checkout of just the .github folder for the header check instead of all the files. Update python checkout version being used. Update the version of the get changed files action being used. * Use echo groups on the header check
1 parent b32aafe commit a936a1b

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/kernel-checks.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ jobs:
99
steps:
1010
# Install python 3
1111
- name: Tool Setup
12-
uses: actions/setup-python@v2
13-
with:
14-
python-version: 3.7.10
15-
architecture: x64
12+
uses: actions/setup-python@v3
1613
env:
1714
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1815

@@ -21,6 +18,7 @@ jobs:
2118
uses: actions/checkout@v3
2219
with:
2320
repository: FreeRTOS/FreeRTOS
21+
sparse-checkout: '.github'
2422
ref: main
2523
path: tools
2624

@@ -32,15 +30,40 @@ jobs:
3230

3331
# Collect all affected files
3432
- name: Collecting changed files
35-
uses: lots0logs/gh-action-get-changed-files@2.1.4
33+
uses: lots0logs/gh-action-get-changed-files@2.2.2
3634
with:
3735
token: ${{ secrets.GITHUB_TOKEN }}
3836

3937
# Run checks
40-
- name: Check File Headers
38+
- env:
39+
bashPass: \033[32;1mPASSED -
40+
bashInfo: \033[33;1mINFO -
41+
bashFail: \033[31;1mFAILED -
42+
bashEnd: \033[0m
43+
stepName: Check File Headers
44+
name: ${{ env.stepName }}
45+
shell: bash
4146
run: |
47+
# ${{ env.stepName }}
48+
echo -e "::group::${{ env.bashInfo }} Install Dependencies ${{ env.bashEnd }}"
49+
50+
# Copy the common tools from the FreeRTOS/FreeRTOS repo.
4251
mv tools/.github/scripts/common inspect/.github/scripts
52+
53+
# Install the necessary python dependencies
4354
pip install -r inspect/.github/scripts/common/requirements.txt
4455
cd inspect
56+
57+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
58+
59+
# Use the python script to check the copyright header of modified files.
4560
.github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
46-
exit $?
61+
exitStatus=$?
62+
echo -e "::endgroup::"
63+
64+
if [ $exitStatus -eq 0 ]; then
65+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
66+
else
67+
echo -e "${{ env.bashFail }} ${{ env.stepName }} ${{ env.bashEnd }}"
68+
fi
69+
exit $exitStatus

0 commit comments

Comments
 (0)