diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..b25067e --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,60 @@ +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + +defaults: + run: + shell: pwsh + +permissions: + contents: read + +jobs: + analyze: + permissions: + actions: read # for github/codeql-action/init to get workflow details + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/analyze to upload SARIF results + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['cpp'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: '0' + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + - run: | + Get-ChildItem -Path env: + name: Capture Environment + + - run: | + tools/releaseBuild/vstsBuild.ps1 -Name 'centos.7' -Verbose + name: Build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13 \ No newline at end of file diff --git a/build.psm1 b/build.psm1 index 4569b19..05832f4 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2052,7 +2052,7 @@ function Start-PSBootstrap { # Install patched version of curl Start-NativeExecution { brew install curl --with-openssl --with-gssapi } -IgnoreExitcode } elseif ($Environment.IsAlpine) { - $Deps += "build-base", "gcc", "abuild", "binutils", "git", "python", "bash", "cmake" + $Deps += "build-base", "gcc", "abuild", "binutils", "git", "python3", "bash", "cmake" # Install dependencies Start-NativeExecution { apk update } diff --git a/tools/releaseBuild/images/Alpine/Dockerfile b/tools/releaseBuild/images/Alpine/Dockerfile index 64279c1..4b3f019 100644 --- a/tools/releaseBuild/images/Alpine/Dockerfile +++ b/tools/releaseBuild/images/Alpine/Dockerfile @@ -1,6 +1,6 @@ -FROM mcr.microsoft.com/powershell:6.1.0-alpine-3.8 +FROM mcr.microsoft.com/powershell:alpine-3.16 RUN apk update \ - && apk add build-base gcc abuild binutils git python bash cmake + && apk add build-base gcc abuild binutils git python3 bash cmake ENTRYPOINT [ "pwsh" ] diff --git a/tools/releaseBuild/images/CentOS/Dockerfile b/tools/releaseBuild/images/CentOS/Dockerfile index 1d21d7f..346bbca 100644 --- a/tools/releaseBuild/images/CentOS/Dockerfile +++ b/tools/releaseBuild/images/CentOS/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/powershell:centos-7 +FROM mcr.microsoft.com/powershell:ubi-8 LABEL maintainer="PowerShell Team " diff --git a/tools/releaseBuild/images/Ubuntu16.04/Dockerfile b/tools/releaseBuild/images/Ubuntu16.04/Dockerfile index 57f16a7..442b223 100644 --- a/tools/releaseBuild/images/Ubuntu16.04/Dockerfile +++ b/tools/releaseBuild/images/Ubuntu16.04/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/powershell:ubuntu-16.04 +FROM mcr.microsoft.com/powershell:ubuntu-22.04 LABEL maintainer="PowerShell Team "