codeql-analysis.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. name: "CodeQL"
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches: [ develop ]
  6. paths:
  7. - 'CMSIS/Core/**'
  8. - 'CMSIS/Core_A/**'
  9. - 'CMSIS/CoreValidation/**'
  10. - 'Device/ARM/**'
  11. pull_request:
  12. branches: [ develop ]
  13. paths:
  14. - '.github/workflows/codeql-analysis.yml'
  15. - 'CMSIS/Core/**'
  16. - 'CMSIS/Core_A/**'
  17. - 'CMSIS/CoreValidation/**'
  18. - 'Device/ARM/**'
  19. jobs:
  20. analyze:
  21. name: Analyze
  22. runs-on: ubuntu-latest
  23. permissions:
  24. actions: read
  25. contents: read
  26. security-events: write
  27. env:
  28. CMSIS_PACK_ROOT: /tmp/.packs-${{ github.run_id }}
  29. steps:
  30. - name: Checkout repository
  31. uses: actions/checkout@v3
  32. - name: Install build dependencies
  33. run: |
  34. sudo apt install gcc-arm-none-eabi ninja-build cmake
  35. - name: Cache pack folder
  36. id: cache-packs
  37. uses: actions/cache@v3
  38. with:
  39. key: packs-${{ github.run_id }}
  40. restore-keys: |
  41. packs-
  42. path: /tmp/.packs-${{ github.run_id }}
  43. - name: Install CMSIS-Toolbox
  44. run: |
  45. wget https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases/download/1.5.0/cmsis-toolbox.sh
  46. chmod +x cmsis-toolbox.sh
  47. sudo ./cmsis-toolbox.sh <<EOI
  48. /opt/ctools
  49. $CMSIS_PACK_ROOT
  50. $(dirname $(which arm-none-eabi-gcc 2>/dev/null))
  51. EOI
  52. echo "/opt/ctools/bin" >> $GITHUB_PATH
  53. echo "cpackget : $(which cpackget)"
  54. echo "csolution: $(which csolution)"
  55. echo "cbuild : $(which cbuild)"
  56. - name: Initialize packs folder
  57. if: steps.cache-packs.outputs.cache-hit != 'true'
  58. run: cpackget init https://www.keil.com/pack/index.pidx
  59. - name: Update pack index
  60. if: steps.cache-packs.outputs.cache-hit == 'true'
  61. run: cpackget update-index
  62. - name: Install build.py requirements
  63. run: pip install -r requirements.txt
  64. working-directory: CMSIS/CoreValidation/Project
  65. # Initializes the CodeQL tools for scanning.
  66. - name: Initialize CodeQL
  67. uses: github/codeql-action/init@v2
  68. with:
  69. languages: cpp
  70. queries: security-and-quality
  71. - name: Build projects
  72. working-directory: CMSIS/CoreValidation/Project
  73. run: |
  74. pip install -r requirements.txt
  75. cpackget add -a -f cpacklist.txt
  76. python build.py --verbose -c GCC -d "CM[047]*" -d "CM[23]3*" -o low build || echo "Something failed!"
  77. - name: Perform CodeQL Analysis
  78. uses: github/codeql-action/analyze@v2