2022-12-02 06:34:21 +00:00
|
|
|
name: SonarCloud
|
2022-12-05 12:55:52 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-12-02 06:34:21 +00:00
|
|
|
on:
|
2022-12-05 12:55:52 +00:00
|
|
|
workflow_dispatch:
|
2022-12-02 06:34:21 +00:00
|
|
|
push:
|
|
|
|
branches:
|
2022-12-26 09:10:39 +00:00
|
|
|
- staged
|
|
|
|
|
2022-12-02 06:34:21 +00:00
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and analyze
|
2024-07-10 03:08:18 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2022-12-02 06:34:21 +00:00
|
|
|
env:
|
|
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
2023-08-05 04:52:12 +00:00
|
|
|
steps:
|
2022-12-04 11:58:54 +00:00
|
|
|
- name: ubuntu install thirdparty dependencies
|
|
|
|
run: |
|
2024-10-16 09:49:00 +00:00
|
|
|
sudo apt-get update
|
|
|
|
|
2024-07-10 03:08:18 +00:00
|
|
|
sudo apt-get install build-essential ninja-build \
|
|
|
|
libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \
|
|
|
|
libxtst-dev liblzo2-dev libbz2-dev \
|
|
|
|
libavutil-dev libavformat-dev libeb16-dev \
|
|
|
|
libzstd-dev libxkbcommon-dev \
|
|
|
|
libxapian-dev libzim-dev libopencc-dev \
|
|
|
|
qt6-5compat-dev \
|
|
|
|
qt6-base-dev \
|
|
|
|
qt6-multimedia-dev \
|
|
|
|
qt6-speech-dev \
|
|
|
|
qt6-svg-dev \
|
|
|
|
qt6-tools-dev \
|
|
|
|
qt6-tools-dev-tools \
|
|
|
|
qt6-webchannel-dev \
|
|
|
|
qt6-webengine-dev
|
2024-04-05 08:35:50 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-12-02 06:34:21 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
2024-07-10 03:08:18 +00:00
|
|
|
submodules: true
|
2022-12-02 06:34:21 +00:00
|
|
|
- name: Install sonar-scanner and build-wrapper
|
2023-08-04 05:51:07 +00:00
|
|
|
uses: SonarSource/sonarcloud-github-c-cpp@v2
|
2022-12-02 06:34:21 +00:00
|
|
|
- name: Run build-wrapper
|
|
|
|
run: |
|
2024-07-10 03:08:18 +00:00
|
|
|
mkdir build_dir
|
|
|
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S . -B ./build_dir -G Ninja
|
2022-12-02 06:34:21 +00:00
|
|
|
- name: Run sonar-scanner
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
run: |
|
2024-07-10 03:08:18 +00:00
|
|
|
sonar-scanner --define sonar.cfamily.compile-commands=./build_dir/compile_commands.json
|