-
-
Notifications
You must be signed in to change notification settings - Fork 21
158 lines (130 loc) · 4.07 KB
/
linux-analysis.yml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: "Linux-based analysis"
env:
COVERAGE: YES
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 16 * * 6'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze_main:
name: Analyze Local
if: github.repository_owner == 'ParadoxGameConverters'
runs-on: [self-hosted, linux]
strategy:
fail-fast: false
matrix:
language: ['cpp']
steps:
- name: "Cloning repo"
uses: actions/checkout@v4
with:
submodules: true
- name: "Cloning selective submodules"
run: |
git submodule update --init --recursive external/common_items
git -c submodule."external/commonItems".update=none \
submodule update --init --recursive external/Fronter
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build solution
run: |
cmake -H. -Bbuild && cmake --build ./build --target Vic2ToHoi4Converter ConverterFrontend Vic2ToHoi4ConverterTests -- -j40
- name: Run tests
run: |
cd build/Release-LinuxTests/
./Vic2ToHoi4ConverterTests
- name: Run gcov
run: |
cd build
pwd
make gcov
- name: Run lcov
run: |
cd build
pwd
make lcov
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: build/lcoverage/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Cleanup
uses: colpal/actions-clean@v1
if: always()
analyze:
name: Analyze Foreign
if: github.repository_owner != 'ParadoxGameConverters'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ['cpp']
steps:
- name: "Cloning repo"
uses: actions/checkout@v4
with:
submodules: true
- name: "Cloning selective submodules"
run: |
git submodule update --init --recursive external/common_items
git -c submodule."external/commonItems".update=none \
submodule update --init --recursive external/Fronter
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Install Prerequisites
run: |
sudo apt-key adv --fetch-keys https://repos.codelite.org/CodeLite.asc
sudo apt-add-repository 'deb https://repos.codelite.org/wx3.2/ubuntu/ jammy universe'
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libwxbase3.2-0-unofficial \
libwxbase3.2unofficial-dev libwxgtk3.2-0-unofficial libwxgtk3.2unofficial-dev \
wx3.2-headers wx-common libnotify-dev libnotify4 libcurl4-openssl-dev lcov
- name: Build solution
run: |
# Link gcc-12 and g++-12 to their standard commands
sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc
sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++
sudo ln -s /usr/bin/gcov-12 /usr/local/bin/gcov
sudo ln -s /usr/bin/lcov /usr/local/bin/lcov
sudo ln -s /usr/bin/geninfo /usr/local/bin/geninfo
# Export CC and CXX to tell cmake which compiler to use
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12
# Check versions of gcc, g++ and cmake
# Run your build commands next
cmake -H. -Bbuild && cmake --build ./build --target Vic2ToHoi4Converter ConverterFrontend Vic2ToHoi4ConverterTests -- -j5
- name: Run tests
run: |
cd build/Release-LinuxTests/
./Vic2ToHoi4ConverterTests
- name: Run gcov
run: |
cd build
pwd
make gcov
- name: Run lcov
run: |
cd build
pwd
make lcov
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: build/lcoverage/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Cleanup
uses: colpal/actions-clean@v1
if: always()