Skip to content

Commit 34a5423

Browse files
committed
AIO Build
1 parent cc63bda commit 34a5423

File tree

3 files changed

+166
-9
lines changed

3 files changed

+166
-9
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: CodeQL_AIO_Native_Larger_Runner_Example.yml
2+
on:
3+
push:
4+
branches: [ main ]
5+
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
Example01_JavaScript:
11+
runs-on: GitHub_Jack_PowerRunner
12+
defaults:
13+
run:
14+
working-directory: /home/runner/work/CodeQL_containerizedApp/CodeQL_containerizedApp/Example01_JavaScript/
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [javascript]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
# Initializes the CodeQL tools for scanning.
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v2
32+
with:
33+
languages:
34+
${{ matrix.language }}
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v2
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v2
41+
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v2
44+
45+
Example02_Java:
46+
needs: Example01_JavaScript
47+
runs-on: GitHub_Jack_PowerRunner
48+
permissions:
49+
actions: read
50+
contents: read
51+
security-events: write
52+
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
language: [Java]
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v3
61+
62+
- name: Install dependencies
63+
working-directory: /home/runner/work/CodeQL_containerizedApp/CodeQL_containerizedApp/Example02_Java/
64+
run: |
65+
sudo apt-get install build-essential maven default-jdk cowsay netcat -y && \
66+
sudo apt-get install -y openjdk-8-jdk && \
67+
sudo update-alternatives --config javac
68+
69+
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v2
72+
with:
73+
languages: ${{ matrix.language }}
74+
75+
- name: Build with Maven
76+
working-directory: /home/runner/work/CodeQL_containerizedApp/CodeQL_containerizedApp/Example02_Java/
77+
run: |
78+
mvn -B package --file pom.xml
79+
80+
- name: Perform CodeQL Analysis
81+
uses: github/codeql-action/analyze@v2
82+
83+
Example03_Csharp:
84+
needs: [Example01_JavaScript, Example02_Java]
85+
runs-on: windows-2022-16core
86+
permissions:
87+
actions: read
88+
contents: read
89+
security-events: write
90+
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
language: [csharp]
95+
96+
97+
steps:
98+
- name: Checkout repository
99+
uses: actions/checkout@v3
100+
101+
- name: Initialize CodeQL
102+
uses: github/codeql-action/init@v2
103+
with:
104+
languages: ${{ matrix.language }}
105+
106+
- name: Setup .NET
107+
uses: actions/setup-dotnet@v3
108+
with:
109+
dotnet-version: 7.0.x
110+
111+
- name: Build with dotnet
112+
working-directory: D:\a\CodeQL_containerizedApp\CodeQL_containerizedApp\Example03_Csharp\WebGoatCore\
113+
run: dotnet build WebGoatCore.csproj
114+
115+
# - name: Autobuild
116+
# uses: github/codeql-action/autobuild@v2
117+
118+
- name: Perform CodeQL Analysis
119+
uses: github/codeql-action/analyze@v2
120+
121+
Example04_Python:
122+
needs: [Example01_JavaScript, Example02_Java, Example03_Csharp]
123+
runs-on: GitHub_Jack_PowerRunner
124+
permissions:
125+
actions: read
126+
contents: read
127+
security-events: write
128+
129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
language: [ 'python' ]
133+
134+
steps:
135+
136+
- name: Checkout repository
137+
uses: actions/checkout@v3
138+
139+
- name: Initialize CodeQL
140+
uses: github/codeql-action/init@v2
141+
with:
142+
languages: ${{ matrix.language }}
143+
144+
- name: Autobuild
145+
uses: github/codeql-action/autobuild@v2
146+
147+
- name: Perform CodeQL Analysis
148+
uses: github/codeql-action/analyze@v2
149+

.github/workflows/CodeQL_AIO_Native_Runner_Example.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
uses: github/codeql-action/analyze@v2
4444

4545
Example02_Java:
46+
needs: Example01_JavaScript
4647
runs-on: Ubuntu-latest
4748
permissions:
4849
actions: read
@@ -65,7 +66,6 @@ jobs:
6566
sudo apt-get install -y openjdk-8-jdk && \
6667
sudo update-alternatives --config javac
6768
68-
6969
- name: Initialize CodeQL
7070
uses: github/codeql-action/init@v2
7171
with:
@@ -75,11 +75,11 @@ jobs:
7575
working-directory: /home/runner/work/CodeQL_containerizedApp/CodeQL_containerizedApp/Example02_Java/
7676
run: |
7777
mvn -B package --file pom.xml
78-
7978
- name: Perform CodeQL Analysis
8079
uses: github/codeql-action/analyze@v2
8180

8281
Example03_Csharp:
82+
needs: [Example01_JavaScript, Example02_Java]
8383
runs-on: windows-latest
8484
permissions:
8585
actions: read
@@ -117,6 +117,7 @@ jobs:
117117
uses: github/codeql-action/analyze@v2
118118

119119
Example04_Python:
120+
needs: [Example01_JavaScript, Example02_Java, Example03_Csharp]
120121
runs-on: ubuntu-latest
121122
permissions:
122123
actions: read
@@ -142,5 +143,4 @@ jobs:
142143
uses: github/codeql-action/autobuild@v2
143144

144145
- name: Perform CodeQL Analysis
145-
uses: github/codeql-action/analyze@v2
146-
146+
uses: github/codeql-action/analyze@v2

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ When your workflow runs, GitHub Actions will start a container using the specifi
9191
|Example01_C# | C# | 7 Minutes and 47 Seconds |
9292
|Example01_Python | Python | 4 Minutes and 39 Seconds |
9393
94-
> #### CodeQL code scanning for containerized applications using [GitHub Larger Runners]([https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners](https://docs.github.com/en/enterprise-cloud@latest/actions/using-github-hosted-runners/about-larger-runners))
94+
***
95+
96+
> #### CodeQL code scanning for containerized applications using [GitHub Larger Runners](https://docs.github.com/en/enterprise-cloud@latest/actions/using-github-hosted-runners/about-larger-runners)
9597
9698
| Example | Programming Language| Scan completion Time |
9799
|---------------------|-------------------- |---------------------- |
@@ -100,11 +102,17 @@ When your workflow runs, GitHub Actions will start a container using the specifi
100102
|Example01_C# | C# | 3 Minutes and 59 Seconds |
101103
|Example01_Python | Python | 2 Minutes and 24 Seconds |
102104
103-
##### Larger Runner Specs and Resources Assigned to the container for each example:
104-
| CPU Cores | RAM | Storage | Base OS | | CPU | RAM | Storage | Base OS |
105-
|-----------|-----|---------|--------- |---|-----|------------------|-----------------|------------------------------------------- |
106-
|8 cores |32GB |300 SSD |Ubuntu 22.04| | 5 |Container Default|Container Default|Review example workflows for container image |
105+
##### Larger Runner Specs:
106+
| CPU Cores | RAM | Storage | Base OS |
107+
|-----------|-----|---------|--------- |
108+
|8 cores |32GB |300 SSD |Ubuntu 22.04|
109+
110+
##### Resources Assigned to the container for each example:
111+
| CPU | RAM | Storage | Base OS |
112+
|-----|------------------|-----------------|------------------------------------------|
113+
|5 |Container Default|Container Default|Review example workflows for container image |
107114
115+
***
108116
109117
> #### CodeQL code scanning for containerized applications - Coverting the application to run natively within a GitHub default Runner rather than within the container.
110118

0 commit comments

Comments
 (0)