|
| 1 | +--- |
| 2 | +name: "CodeQL" |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [main, v*.x] |
| 7 | + pull_request: |
| 8 | + # The branches below must be a subset of the branches above |
| 9 | + branches: [main] |
| 10 | + schedule: |
| 11 | + - cron: '45 19 * * 1' |
| 12 | + |
| 13 | +jobs: |
| 14 | + analyze: |
| 15 | + name: Analyze |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + actions: read |
| 19 | + contents: read |
| 20 | + security-events: write |
| 21 | + |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + language: ['cpp', 'javascript', 'python'] |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v3 |
| 30 | + |
| 31 | + - name: Set up Python |
| 32 | + uses: actions/setup-python@v4 |
| 33 | + if: matrix.language != 'javascript' |
| 34 | + with: |
| 35 | + python-version: '3.x' |
| 36 | + - name: Install dependencies |
| 37 | + if: matrix.language != 'javascript' |
| 38 | + run: | |
| 39 | + python -m pip install --upgrade pip setuptools wheel |
| 40 | + # TODO: Use pip-tools instead when it supports build-system |
| 41 | + # dependencies so we don't need another copy here. |
| 42 | + # https://github.com/jazzband/pip-tools/pull/1681 |
| 43 | + python -m pip install --upgrade \ |
| 44 | + certifi contourpy cycler fonttools kiwisolver importlib_resources \ |
| 45 | + numpy packaging pillow pyparsing python-dateutil setuptools-scm |
| 46 | + echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV |
| 47 | +
|
| 48 | + - name: Initialize CodeQL |
| 49 | + uses: github/codeql-action/init@v2 |
| 50 | + with: |
| 51 | + languages: ${{ matrix.language }} |
| 52 | + setup-python-dependencies: false |
| 53 | + |
| 54 | + - name: Build compiled code |
| 55 | + if: matrix.language == 'cpp' |
| 56 | + run: | |
| 57 | + mkdir ~/.cache/matplotlib |
| 58 | + $CODEQL_PYTHON setup.py build |
| 59 | +
|
| 60 | + - name: Perform CodeQL Analysis |
| 61 | + uses: github/codeql-action/analyze@v2 |
0 commit comments