From d932b7e943974a79d334098f20ffe7f0426c7cac Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 15 Dec 2023 19:40:27 -0500 Subject: [PATCH] Revert "Fold Code Scanning into CI Pipeline" This reverts commit 9ba8952809a8a6f3c11ac05ed7c2f00d84010a33. --- .github/workflows/ci-pipeline.yml | 34 +----------------- .github/workflows/code-scanning.yml | 55 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/code-scanning.yml diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 41d156de2a..4f5a0f95d2 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -83,38 +83,6 @@ jobs: - name: GitHub Requires at Least One Step for a Job run: exit 0 - analyze: - name: Code Scanning - needs: start-ci-run-gate - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success' && ${{ vars.TGS_ENABLE_CODE_QL }} == 'true') - steps: - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '${{ env.TGS_DOTNET_VERSION }}.0.x' - dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }} - - - name: Checkout - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: csharp - - - name: Build - run: dotnet build -c ReleaseNoWindows -p:TGS_HOST_NO_WEBPANEL=true - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:csharp" - dmapi-build: name: Build DMAPI needs: start-ci-run-gate @@ -1355,7 +1323,7 @@ jobs: ci-completion-gate: # This job exists so there isn't a moving target for branch protections name: CI Completion Gate - needs: [ pages-build, docker-build, build-deb, build-msi, validate-openapi-spec, upload-code-coverage, check-winget-pr-template, analyze ] + needs: [ pages-build, docker-build, build-deb, build-msi, validate-openapi-spec, upload-code-coverage, check-winget-pr-template ] runs-on: ubuntu-latest if: (!(cancelled() || failure()) && needs.pages-build.result == 'success' && needs.docker-build.result == 'success' && needs.build-deb.result == 'success' && needs.build-msi.result == 'success' && needs.validate-openapi-spec.result == 'success' && needs.upload-code-coverage.result == 'success' && needs.check-winget-pr-template.result == 'success') steps: diff --git a/.github/workflows/code-scanning.yml b/.github/workflows/code-scanning.yml new file mode 100644 index 0000000000..9442ce5530 --- /dev/null +++ b/.github/workflows/code-scanning.yml @@ -0,0 +1,55 @@ +name: 'Code Scanning' + +on: + schedule: + - cron: 0 23 * * 1 + push: + branches: + - dev + - master + - V6 + pull_request: + branches: + - dev + - master + - V6 + +env: + TGS_DOTNET_VERSION: 8 + TGS_DOTNET_QUALITY: ga + +concurrency: + group: "code-scanning-${{ github.head_ref || github.run_id }}-${{ github.event_name }}" + cancel-in-progress: true + +jobs: + analyze: + name: Code Scanning + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + if: ${{ vars.TGS_ENABLE_CODE_QL }} == 'true' + steps: + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '${{ env.TGS_DOTNET_VERSION }}.0.x' + dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }} + + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: csharp + + - name: Build + run: dotnet build -c ReleaseNoWindows -p:TGS_HOST_NO_WEBPANEL=true + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:csharp"