arctic/github-codeql-1 #9
Workflow file for this run
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: GenCI | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| security-events: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| name: Detect File Changes | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| generals: ${{ steps.filter.outputs.generals }} | |
| generalsmd: ${{ steps.filter.outputs.generalsmd }} | |
| shared: ${{ steps.filter.outputs.shared }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Filter Changed Paths | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| token: '' | |
| filters: | | |
| generals: | |
| - 'Generals/**' | |
| generalsmd: | |
| - 'GeneralsMD/**' | |
| shared: | |
| - 'Dependencies/**' | |
| - 'cmake/**' | |
| - 'CMakeLists.txt' | |
| - 'CMakePresets.json' | |
| - ".github/workflows/ci.yml" | |
| - '.github/workflows/build-toolchain.yml' | |
| - name: Changes Summary | |
| run: | | |
| echo "### π File Changes Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "- Generals: ${{ steps.filter.outputs.generals == 'true' && 'β ' || 'β' }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- GeneralsMD: ${{ steps.filter.outputs.generalsmd == 'true' && 'β ' || 'β' }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- Shared: ${{ steps.filter.outputs.shared == 'true' && 'β ' || 'β' }}" >> $GITHUB_STEP_SUMMARY | |
| codeql-analysis: | |
| name: CodeQL Analysis | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v2 | |
| with: | |
| languages: cpp | |
| queries: security-and-quality | |
| - name: Set Up VC2022 Environment | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x86 | |
| - name: Configure CMake | |
| shell: pwsh | |
| run: | | |
| # Configure a build to allow CodeQL to analyze the code | |
| cmake --preset win32 -DGENZH_BUILD_ZEROHOUR_EXTRAS=ON -DGENZH_BUILD_GENERALS_EXTRAS=ON | |
| - name: Build with CMake | |
| shell: pwsh | |
| run: | | |
| cmake --build --preset win32 | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v2 | |
| with: | |
| category: "/language:cpp" | |
| build-generals: | |
| name: Build Generals${{ matrix.preset && '' }} | |
| needs: detect-changes | |
| if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.generals == 'true' || needs.detect-changes.outputs.shared == 'true' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - preset: "vc6" | |
| tools: true | |
| extras: true | |
| - preset: "vc6prof" | |
| tools: true | |
| extras: true | |
| - preset: "vc6int" | |
| tools: true | |
| extras: true | |
| - preset: "vc6dbg" | |
| tools: true | |
| extras: true | |
| - preset: "win32" | |
| tools: true | |
| extras: true | |
| - preset: "win32prof" | |
| tools: true | |
| extras: true | |
| - preset: "win32int" | |
| tools: true | |
| extras: true | |
| - preset: "win32dbg" | |
| tools: true | |
| extras: true | |
| fail-fast: false | |
| uses: ./.github/workflows/build-toolchain.yml | |
| with: | |
| game: "Generals" | |
| preset: ${{ matrix.preset }} | |
| tools: ${{ matrix.tools }} | |
| extras: ${{ matrix.extras }} | |
| secrets: inherit | |
| build-generalsmd: | |
| name: Build GeneralsMD${{ matrix.preset && '' }} | |
| needs: detect-changes | |
| if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.generalsmd == 'true' || needs.detect-changes.outputs.shared == 'true' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - preset: "vc6" | |
| tools: true | |
| extras: true | |
| - preset: "vc6prof" | |
| tools: true | |
| extras: true | |
| - preset: "vc6int" | |
| tools: true | |
| extras: true | |
| - preset: "vc6dbg" | |
| tools: true | |
| extras: true | |
| - preset: "win32" | |
| tools: true | |
| extras: true | |
| - preset: "win32prof" | |
| tools: true | |
| extras: true | |
| - preset: "win32int" | |
| tools: true | |
| extras: true | |
| - preset: "win32dbg" | |
| tools: true | |
| extras: true | |
| fail-fast: false | |
| uses: ./.github/workflows/build-toolchain.yml | |
| with: | |
| game: "GeneralsMD" | |
| preset: ${{ matrix.preset }} | |
| tools: ${{ matrix.tools }} | |
| extras: ${{ matrix.extras }} | |
| secrets: inherit |