Skip to content

Commit

Permalink
Add CodeQL build (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan authored Jul 25, 2024
1 parent dd361f8 commit 4481c68
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions tools/releaseBuild/images/Alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
2 changes: 1 addition & 1 deletion tools/releaseBuild/images/CentOS/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/powershell:centos-7
FROM mcr.microsoft.com/powershell:ubi-8

LABEL maintainer="PowerShell Team <[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion tools/releaseBuild/images/Ubuntu16.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/powershell:ubuntu-16.04
FROM mcr.microsoft.com/powershell:ubuntu-22.04

LABEL maintainer="PowerShell Team <[email protected]>"

Expand Down

0 comments on commit 4481c68

Please sign in to comment.