ci: actions: static analysis: Look for matching branch for deps first #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Static Analysis" | |
| on: [push] | |
| jobs: | |
| codeql: | |
| name: codeql | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: ['cpp'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: apt-get install packages | |
| run: sudo apt-get update -qq && | |
| sudo apt-get install --no-install-recommends -y | |
| bison | |
| build-essential | |
| check | |
| clang | |
| flex | |
| git | |
| gperf | |
| llvm | |
| pkg-config | |
| - name: Get env.sh | |
| run: | | |
| mkdir projects | |
| wget -O projects/env.sh https://raw.githubusercontent.com/netsurf-browser/netsurf/refs/heads/master/docs/env.sh | |
| - name: Build and install project deps | |
| env: | |
| TARGET: ${{ github.event.repository.name }} | |
| REPO_BASE_URI: https://github.com/netsurf-browser | |
| TARGET_WORKSPACE: "${{ github.workspace }}/projects" # Same as "$(pwd)/projects" | |
| run: | | |
| source projects/env.sh | |
| ns-clone -d -s -b ${GITHUB_REF_NAME} | |
| ns-make-libs install | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: ${{ matrix.language }} | |
| - name: Build Library | |
| env: | |
| TARGET_WORKSPACE: "${{ github.workspace }}/projects" # Same as "$(pwd)/projects" | |
| run: | | |
| source projects/env.sh | |
| make -j"$(nproc)" | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 |