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:
|
|
|
|
- dev
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and analyze
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
|
|
|
steps:
|
2022-12-04 11:58:54 +00:00
|
|
|
- uses: actions/setup-python@v3
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v3
|
|
|
|
with:
|
2022-12-05 02:43:06 +00:00
|
|
|
version: 6.3.2
|
|
|
|
arch: gcc_64
|
2022-12-04 11:58:54 +00:00
|
|
|
cached: 'false'
|
|
|
|
#serialport linuxdeploy need serialport to work.
|
|
|
|
modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport
|
|
|
|
setup-python: 'false'
|
|
|
|
|
|
|
|
- name: ubuntu install thirdparty dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get install git pkg-config build-essential
|
|
|
|
sudo apt-get install libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev
|
|
|
|
sudo apt-get install libxtst-dev liblzo2-dev libbz2-dev
|
|
|
|
sudo apt-get install libao-dev libavutil-dev libavformat-dev libtiff5-dev libeb16-dev
|
|
|
|
sudo apt-get install doxygen libzstd-dev libxkbcommon-dev libgstreamer-plugins-base1.0-0 libgstreamer-gl1.0-0
|
|
|
|
sudo ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld
|
|
|
|
|
|
|
|
#build opencc
|
|
|
|
git clone https://github.com/BYVoid/OpenCC
|
|
|
|
cd OpenCC/
|
|
|
|
make PREFIX=/usr -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
cd ..
|
2022-12-02 06:34:21 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
2022-12-05 05:39:30 +00:00
|
|
|
submodules: true
|
2022-12-02 06:34:21 +00:00
|
|
|
- name: Install sonar-scanner and build-wrapper
|
|
|
|
uses: SonarSource/sonarcloud-github-c-cpp@v1
|
|
|
|
- name: Run build-wrapper
|
|
|
|
run: |
|
2022-12-05 12:55:52 +00:00
|
|
|
qmake CONFIG+=release CONFIG+=no_extra_tiff_handler CONFIG+=zim_support CONFIG+=chinese_conversion_support
|
|
|
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -j8
|
2022-12-02 06:34:21 +00:00
|
|
|
- name: Run sonar-scanner
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
run: |
|
|
|
|
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
|