Skip to content

Commit 4481c68

Browse files
Add CodeQL build (#99)
1 parent dd361f8 commit 4481c68

File tree

5 files changed

+65
-5
lines changed

5 files changed

+65
-5
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [master]
9+
10+
defaults:
11+
run:
12+
shell: pwsh
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
analyze:
19+
permissions:
20+
actions: read # for github/codeql-action/init to get workflow details
21+
contents: read # for actions/checkout to fetch code
22+
security-events: write # for github/codeql-action/analyze to upload SARIF results
23+
name: Analyze
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
# Override automatic language detection by changing the below list
30+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
31+
language: ['cpp']
32+
# Learn more...
33+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
38+
with:
39+
fetch-depth: '0'
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
51+
- run: |
52+
Get-ChildItem -Path env:
53+
name: Capture Environment
54+
55+
- run: |
56+
tools/releaseBuild/vstsBuild.ps1 -Name 'centos.7' -Verbose
57+
name: Build
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13

build.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ function Start-PSBootstrap {
20522052
# Install patched version of curl
20532053
Start-NativeExecution { brew install curl --with-openssl --with-gssapi } -IgnoreExitcode
20542054
} elseif ($Environment.IsAlpine) {
2055-
$Deps += "build-base", "gcc", "abuild", "binutils", "git", "python", "bash", "cmake"
2055+
$Deps += "build-base", "gcc", "abuild", "binutils", "git", "python3", "bash", "cmake"
20562056

20572057
# Install dependencies
20582058
Start-NativeExecution { apk update }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM mcr.microsoft.com/powershell:6.1.0-alpine-3.8
1+
FROM mcr.microsoft.com/powershell:alpine-3.16
22

33
RUN apk update \
4-
&& apk add build-base gcc abuild binutils git python bash cmake
4+
&& apk add build-base gcc abuild binutils git python3 bash cmake
55

66
ENTRYPOINT [ "pwsh" ]

tools/releaseBuild/images/CentOS/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/powershell:centos-7
1+
FROM mcr.microsoft.com/powershell:ubi-8
22

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

tools/releaseBuild/images/Ubuntu16.04/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/powershell:ubuntu-16.04
1+
FROM mcr.microsoft.com/powershell:ubuntu-22.04
22

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

0 commit comments

Comments
 (0)