Skip to content

Linux-based analysis #349

Linux-based analysis

Linux-based analysis #349

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@v3
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@v4
with:
name: coverage-report
path: build/lcoverage/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- 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@v3
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@v4
with:
name: coverage-report
path: build/lcoverage/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: Cleanup
uses: colpal/actions-clean@v1
if: always()