codeql-analysis.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # CodeQL semantic code analysis engine
  2. name: "CodeQL"
  3. on:
  4. push:
  5. branches: [ master ]
  6. pull_request:
  7. # The branches below must be a subset of the branches above
  8. branches: [ master ]
  9. schedule:
  10. - cron: '39 2 * * 5'
  11. jobs:
  12. analyze:
  13. name: Analyze
  14. runs-on: ubuntu-22.04
  15. permissions:
  16. actions: read
  17. contents: read
  18. security-events: write
  19. strategy:
  20. fail-fast: false
  21. matrix:
  22. language: [ 'cpp', 'python' ]
  23. # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
  24. # Learn more about CodeQL language support at https://git.io/codeql-language-support
  25. steps:
  26. - name: Checkout repository
  27. uses: actions/checkout@v3
  28. with:
  29. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  30. fetch-depth: 0
  31. - name: Set up Python
  32. uses: actions/setup-python@v4
  33. with:
  34. python-version: 3.9
  35. - name: Cache pip
  36. uses: actions/cache@v3
  37. with:
  38. path: ~/.cache/pip
  39. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  40. restore-keys: |
  41. ${{ runner.os }}-pip-
  42. ${{ runner.os }}-
  43. - name: Install requirements
  44. run: |
  45. sudo apt-get update
  46. sudo apt-get install -y pkg-config build-essential
  47. sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
  48. # Initializes the CodeQL tools for scanning.
  49. - name: Initialize CodeQL
  50. uses: github/codeql-action/init@v2
  51. with:
  52. languages: ${{ matrix.language }}
  53. # If you wish to specify custom queries, you can do so here or in a config file.
  54. # By default, queries listed here will override any specified in a config file.
  55. # Prefix the list here with "+" to use these queries and those in the config file.
  56. # queries: ./path/to/local/query, your-org/your-repo/queries@main
  57. - name: Build and install Borg
  58. run: |
  59. python3 -m venv ../borg-env
  60. source ../borg-env/bin/activate
  61. pip3 install -r requirements.d/development.txt
  62. pip3 install -e .
  63. - name: Perform CodeQL Analysis
  64. uses: github/codeql-action/analyze@v2