CodeQL Advanced #65
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: "CodeQL Advanced" | |
| on: | |
| push: | |
| # branches: | |
| # - 'testing' | |
| tags: | |
| - "testing" | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| repository_dispatch: | |
| #pull_request: | |
| # branches: | |
| # - main | |
| # - "test*" | |
| jobs: | |
| analyze: | |
| name: Analyze (${{ matrix.runner_name }}-${{ matrix.language }}) | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| security-events: write | |
| packages: read | |
| actions: read | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # run codeQL on SHR: Go | |
| - language: go | |
| build-mode: autobuild | |
| runner: [self-hosted, ubu2204-gor] | |
| runner_name: "runner-ubu2204-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on SHR: Go | |
| - language: go | |
| build-mode: autobuild | |
| runner: [self-hosted, ubu2404-gor] | |
| runner_name: "runner-ubu2404-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on SHR: C/C++ | |
| - language: c-cpp | |
| build-mode: manual | |
| runner: [self-hosted, ubu2204-gor] | |
| runner_name: "runner-ubu2204-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on SHR: C/C++ | |
| - language: c-cpp | |
| build-mode: manual | |
| runner: [self-hosted, ubu2404-gor] | |
| runner_name: "runner-ubu2404-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on SHR: Actions | |
| - language: actions | |
| build-mode: none | |
| runner: [self-hosted, ubu2204-gor] | |
| runner_name: "runner-ubu2204-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on SHR: Actions | |
| - language: actions | |
| build-mode: none | |
| runner: [self-hosted, ubu2404-gor] | |
| runner_name: "runner-ubu2404-gor-001" | |
| ram: 8 | |
| cache: false | |
| # run codeQL on GH: Actions | |
| - language: actions | |
| build-mode: none | |
| runner: ubuntu-latest | |
| runner_name: "GH-ubuntu-latest" | |
| ram: 6 | |
| cache: true | |
| # run codeQL on GH: Go | |
| - language: go | |
| build-mode: autobuild | |
| runner: ubuntu-latest | |
| runner_name: "GH-ubuntu-latest" | |
| ram: 6 | |
| cache: true | |
| # run codeQL on GH: C/C++ | |
| - language: c-cpp | |
| build-mode: manual | |
| runner: ubuntu-latest | |
| runner_name: "GH-ubuntu-latest" | |
| ram: 6 | |
| cache: true | |
| steps: | |
| - name: Show actor | |
| run: echo "Triggered by ${{ github.actor }}" | |
| # Block unallowed push users | |
| - name: Block unallowed push user | |
| if: github.event_name == 'push' && github.actor != 'go-while' | |
| run: | | |
| echo "Push not allowed for user ${{ github.actor }}" | |
| exit 1 | |
| # Block unallowed PR users | |
| - name: Block unallowed PR user | |
| if: github.event_name == 'pull_request' && github.event.pull_request.user.login != 'go-while' | |
| run: | | |
| echo "Pull request not allowed for user ${{ github.event.pull_request.user.login }}" | |
| exit 1 | |
| - name: "@Start Clean directory" | |
| run: | | |
| echo "deleting workspace" | |
| rm -rf dist build ${{ github.workspace }}/ | |
| mkdir -vp ${{ github.workspace }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| if: matrix.language == 'go' | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24.3' # or whatever version you need | |
| cache: ${{ matrix.cache }} | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| build-mode: ${{ matrix.build-mode }} | |
| queries: security-extended,security-and-quality | |
| ram: ${{ matrix.ram }} | |
| - name: Autobuild | |
| if: matrix.language == 'go' && matrix.build-mode == 'autobuild' | |
| # Run the autobuild step only for Go jobs | |
| uses: github/codeql-action/autobuild@v3 | |
| - name: Build (manual, for C/C++) | |
| if: matrix.language == 'c-cpp' && matrix.build-mode != 'autobuild' | |
| # Run the build step only for C/C++ jobs | |
| run: | | |
| cd rapidyenc | |
| if [ ! -e rapidyenc ]; then | |
| ./clone_rapidyenc.sh | |
| if [ ! -e rapidyenc/.git ]; then | |
| echo "rapidyenc/ src not found, exiting" | |
| exit 1 | |
| fi | |
| else | |
| echo "rapidyenc/ src exists, skipping clone" | |
| fi | |
| ./build_rapidyenc_linux-amd64.sh | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| - name: "@End Clean directory" | |
| run: | | |
| echo "deleting workspace" | |
| rm -rf dist build ${{ github.workspace }}/ | |
| mkdir -vp ${{ github.workspace }} |