enable compatibility with git action + create autorelease action

This commit is contained in:
David Chalco 2020-12-18 03:49:05 -08:00
parent eb6196cff5
commit 0f30b68ead
3 changed files with 18 additions and 15 deletions

View file

@ -29,7 +29,9 @@ KERNEL_IGNORED_EXTENSIONS = [
'.sh' '.sh'
] ]
KERNEL_IGNORED_PATTERNS = [r'.*\.git.*'] KERNEL_IGNORED_PATTERNS = [
r'.*\.git.*'
]
KERNEL_HEADER = [ KERNEL_HEADER = [
'/*\n', '/*\n',
@ -62,15 +64,15 @@ KERNEL_HEADER = [
def main(): def main():
parser = HeaderChecker.configArgParser() parser = HeaderChecker.configArgParser()
args = parser.parse_args()
# Configure the checks then run
checker = HeaderChecker(KERNEL_HEADER) checker = HeaderChecker(KERNEL_HEADER)
checker.ignoreExtension(*KERNEL_IGNORED_EXTENSIONS) checker.ignoreExtension(*KERNEL_IGNORED_EXTENSIONS)
checker.ignorePattern(*KERNEL_IGNORED_PATTERNS) checker.ignorePattern(*KERNEL_IGNORED_PATTERNS)
checker.ignoreFile(os.path.split(__file__)[-1]) checker.ignoreFile(os.path.split(__file__)[-1])
n_failed = 0 return checker.processArgs(args)
return n_failed
if __name__ == '__main__': if __name__ == '__main__':
exit(main()) exit(main())

View file

@ -26,18 +26,19 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Currently FreeRTOS/.github/scripts houses the release script. Download it for upcoming usage
- name: Checkout FreeRTOS Release Tools - name: Checkout FreeRTOS Release Tools
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
repository: dachalco/FreeRTOS # TODO: This is only for my debugging. Before merging upstream this should be updated repository: FreeRTOS/FreeRTOS
ref: autorelease/enhancements
path: tools path: tools
token: ${{ secrets.GITHUB_TOKEN }}
# Simpler git auth if we use checkout action and forward the repo to release script
- name: Checkout FreeRTOS Kernel - name: Checkout FreeRTOS Kernel
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: local_kernel path: local_kernel
fetch-depth: 0
- name: Release - name: Release
run: | run: |
@ -45,9 +46,9 @@ jobs:
git config --global user.name ${{ github.actor }} git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com git config --global user.email ${{ github.actor }}@users.noreply.github.com
# Run the release script # Install deps and run
pip install -r ./tools/.github/scripts/release-requirements.txt pip install -r ./tools/.github/scripts/release-requirements.txt
./tools/.github/scripts/release.py dachalco --kernel-repo-path=local_kernel --kernel-commit=${{ github.event.inputs.commit_id }} --new-kernel-version=${{ github.event.inputs.version_number }} ./tools/.github/scripts/release.py FreeRTOS --kernel-repo-path=local_kernel --kernel-commit=${{ github.event.inputs.commit_id }} --new-kernel-version=${{ github.event.inputs.version_number }}
exit $? exit $?
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,10 +1,10 @@
name: FreeRTOS-Header-Checker name: Kernel-Checker
on: [pull_request] on: [pull_request]
jobs: jobs:
header-checker: kernel-checker:
name: File Header Checks name: FreeRTOS Kernel Header Checks
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Install python 3 # Install python 3
@ -40,8 +40,8 @@ jobs:
# Run checks # Run checks
- name: Check File Headers - name: Check File Headers
run: | run: |
mv tools/.github/scripts/common inspect/.github/scripts
cd inspect cd inspect
export PYTHONPATH=../tools/.github/scripts:${PYTHONPATH}
.github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json .github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
exit $? exit $?