forked from ghasctl/puppeteer-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (110 loc) · 4.46 KB
/
codeql-analysis-csharp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "CodeQL C#"
on:
push:
branches: ["master", "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master", "main"]
schedule:
- cron: "27 4 * * 5"
env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
jobs:
build:
name: build-${{ matrix.browser }}/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [FIREFOX,CHROME]
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "csharp"
queries: security-extended # security-and-quality
# build-mode: none
build-mode: manual
- name: Install dependencies
run: |
dotnet restore lib/PuppeteerSharp.sln
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
sudo update-ca-certificates
- name: Build
run: dotnet build lib/PuppeteerSharp.sln
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: upload output to artifact
uses: actions/upload-artifact@v4
with:
name: csharp_scanning
path: |
/home/runner/work/puppeteer-sharp-test/results/csharp.sarif
/home/runner/work/_temp/codeql_databases/csharp.zip
# analyze:
# name: Analyze
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
# strategy:
# fail-fast: false
# matrix:
# language: ["csharp"]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# # Initializes the CodeQL tools for scanning.
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v3
# with:
# languages: ${{ matrix.language }}
# queries: security-extended # security-and-quality
# # build-mode: none
# build-mode: manual
# # 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.
# # # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# # # If this step fails, then you should remove it and run the build manually (see below)
# # - name: Autobuild
# # uses: github/codeql-action/autobuild@v3
# # ℹ️ Command-line programs to run using the OS shell.
# # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# # If the Autobuild fails above, remove it and uncomment the following three lines.
# # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# # - run: |
# # echo "Run, Build Application using script"
# # ./location_of_script_within_repo/buildscript.sh
# # - name: Install dependencies
# # run: |
# # dotnet restore lib/PuppeteerSharp.sln
# # dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
# # sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
# # sudo update-ca-certificates
# # - name: Build
# # run: |
# # echo "Run, Build Application using script"
# # dotnet build lib/PuppeteerSharp.sln
# # - run: |
# # echo 'If you are using a "manual" build mode for one or more of the' \
# # 'languages you are analyzing, replace this with the commands to build' \
# # 'your code, for example:'
# # echo ' make bootstrap'
# # echo ' make release'
# # exit 1
# # dotnet build
# # MSbuild
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v3
# with:
# category: "/language:${{matrix.language}}"