Skip to content

Commit b6ffcfa

Browse files
Merge pull request #4371 from Ginger-Automation/security-scan
CodeQL security scan workflow yml added
2 parents 0b49dc3 + ca6e19e commit b6ffcfa

2 files changed

Lines changed: 111 additions & 70 deletions

File tree

.github/workflows/Old/codeql-analysis.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Security Scan"
13+
14+
on:
15+
push:
16+
branches: [ master, Features/Linux-Migration, Releases/*, Releases/*/*, security-scan ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '0 0 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: CodeQL - ${{ matrix.language }} - ${{ matrix.os }}
26+
runs-on: ${{ matrix.os }}
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'csharp', 'javascript' ]
36+
os: [ubuntu-latest, windows-latest]
37+
38+
# ------------------------------------------------------------------------------------------------------
39+
# Checkout Ginger Repository
40+
# ------------------------------------------------------------------------------------------------------
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
45+
46+
# ------------------------------------------------------------------------------------------------------
47+
# Initialize CodeQL
48+
# ------------------------------------------------------------------------------------------------------
49+
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v3
52+
with:
53+
languages: ${{ matrix.language }}
54+
55+
# ------------------------------------------------------------------------------------------------------
56+
# Install .Net core SDK 8.0.100
57+
# ------------------------------------------------------------------------------------------------------
58+
59+
- name: Install .NET 8
60+
uses: actions/setup-dotnet@v3
61+
with:
62+
dotnet-version: '8.0.100'
63+
64+
# ------------------------------------------------------------------------------------------------------
65+
# Install Mono - for Ubuntu & macOS as pre-requisite for building Ginger
66+
# ------------------------------------------------------------------------------------------------------
67+
68+
- name: Install Mono - Linux
69+
if: runner.os == 'Linux'
70+
run: |
71+
sudo apt-get update
72+
sudo apt-get install -y mono-complete
73+
74+
- name: 'Install Mono - macOS'
75+
if: runner.os == 'macOS'
76+
run: brew install mono
77+
78+
# ------------------------------------------------------------------------------------------------------
79+
# Build && Publish Ginger Solution
80+
# ------------------------------------------------------------------------------------------------------
81+
82+
- name: Setup Nuget
83+
uses: Nuget/setup-nuget@v1.0.5
84+
85+
- name: Restore Nuget Packages
86+
run: nuget restore ./Ginger/Ginger.sln
87+
88+
- name: Add msbuild to PATH
89+
if: runner.os == 'windows'
90+
uses: microsoft/setup-msbuild@v1.0.2
91+
92+
- name: Build Windows Ginger Solution
93+
if: runner.os == 'windows'
94+
run: msbuild ./Ginger/Ginger.sln /p:DebugSymbols=true /p:DebugType=full /p:Configuration=Release
95+
96+
- name: Publish GingerRuntime - Linux
97+
if: runner.os == 'Linux'
98+
run: dotnet publish ./Ginger/GingerRuntime/GingerRuntime.csproj --runtime linux-x64 --self-contained true -c Release
99+
100+
- name: Publish GingerRuntime - macOS
101+
if: runner.os == 'macOS'
102+
run: dotnet publish ./Ginger/GingerRuntime/GingerRuntime.csproj --runtime osx-x64 --self-contained true -c Release
103+
104+
# ------------------------------------------------------------------------------------------------------
105+
# Security Scan with CodeQL
106+
# ------------------------------------------------------------------------------------------------------
107+
108+
- name: Perform CodeQL Analysis
109+
uses: github/codeql-action/analyze@v3
110+
with:
111+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)