Browse Source

Merge pull request #15321 from Chocobo1/ci

Clean up workflow files coding style
adaptive-webui-19844
Chocobo1 3 years ago committed by GitHub
parent
commit
521ef8e28f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 125
      .github/workflows/ci.yaml
  2. 43
      .github/workflows/coverity-scan.yml
  3. 12
      .github/workflows/file_health.yaml
  4. 16
      .github/workflows/webui_ci.yaml

125
.github/workflows/ci.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
name: GitHub Actions CI
name: CI - Main
# Cache is used for all Windows and macOS dependencies (size approx. 1230 * 2 + 1850 = 4310 MiB)
# Cache is not used for Ubuntu builds, because it already has all dependencies except
@ -13,8 +13,7 @@ env: @@ -13,8 +13,7 @@ env:
LIBTORRENT_VERSION_TAG: v1.2.14
jobs:
ci_ubuntu:
ubuntu:
name: Ubuntu
strategy:
@ -30,10 +29,10 @@ jobs: @@ -30,10 +29,10 @@ jobs:
shell: bash
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
- name: install all build dependencies except libtorrent from Ubuntu repos
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
@ -44,35 +43,43 @@ jobs: @@ -44,35 +43,43 @@ jobs:
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
- name: install Qt 5.15.2 from an external PPA
- name: Install Qt
run: |
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
sudo apt install qt515base qt515svg qt515tools
sudo apt install \
qt515base qt515svg qt515tools
- name: install libtorrent from source
- name: Install libtorrent
run: |
git clone https://github.com/arvidn/libtorrent && cd libtorrent
git clone https://github.com/arvidn/libtorrent
cd libtorrent
git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
cmake -B cmake-build-dir -G "Ninja" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Ddeprecated-functions=OFF \
--graphviz=cmake-build-dir/target_graph.dot
cmake --build cmake-build-dir
sudo cmake --install cmake-build-dir --prefix /usr/local
cmake --build build
sudo cmake --install build --prefix /usr/local
- name: build qBittorrent
- name: Build qBittorrent
run: |
cmake -B build -G "Ninja" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D${{ matrix.qbt_gui }} \
-DVERBOSE_CONFIGURE=ON \
--graphviz=build/target_graph.dot
cmake --build build
- name: install qBittorrent
- name: Install qBittorrent
run: sudo cmake --install build --prefix /usr/local
- name: upload artifact as zip
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: qBittorrent-CI_${{ matrix.os }}-x64_${{ matrix.qbt_gui }}
@ -85,9 +92,8 @@ jobs: @@ -85,9 +92,8 @@ jobs:
libtorrent/cmake-build-dir/compile_commands.json
libtorrent/cmake-build-dir/target_graph.dot
ci_windows:
name: Windows + vcpkg
windows:
name: Windows
runs-on: windows-2019
defaults:
@ -95,15 +101,15 @@ jobs: @@ -95,15 +101,15 @@ jobs:
shell: pwsh
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
# - ninja is needed for building qBittorrent (because it's preferable, not a hard requirement)
- name: install additional required packages with chocolatey
- name: Install build tools
run: |
choco install ninja
- name: setup vcpkg (cached, if possible)
- name: Setup vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgDirectory: ${{ env.VCPKG_DEST_WIN }}
@ -111,16 +117,21 @@ jobs: @@ -111,16 +117,21 @@ jobs:
setupOnly: true
# Tell vcpkg to only build Release variants of the dependencies
- name: configure vcpkg triplet overlay for release builds only
- name: Configure vcpkg triplet overlay
run: |
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake `
New-Item `
-Path ${{ github.workspace }} `
-Name "triplets_overlay" `
-ItemType Directory
Copy-Item `
${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake `
${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake
Add-Content ${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake `
Add-Content `
${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake `
-Value "set(VCPKG_BUILD_TYPE release)"
# clear buildtrees after each package installation to reduce disk space requirements
- name: install dependencies via vcpkg
- name: Install dependencies
run: |
$packages = `
"boost-circular-buffer:x64-windows-static-release",
@ -140,14 +151,17 @@ jobs: @@ -140,14 +151,17 @@ jobs:
}
# NOTE: this is necessary to correctly find and use cl.exe with the Ninja generator for now
- name: setup devcmd
- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
- name: build qBittorrent
- name: Build qBittorrent
shell: cmd
run: |
cmake -B build -G "Ninja" ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
cmake ^
-B build ^
-G "Ninja" ^
-DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_WIN }}\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release ^
-DVERBOSE_CONFIGURE=ON ^
@ -155,7 +169,7 @@ jobs: @@ -155,7 +169,7 @@ jobs:
--graphviz=build\target_graph.dot
cmake --build build
- name: upload artifact as zip
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: qBittorrent-CI_Windows-x64
@ -166,54 +180,59 @@ jobs: @@ -166,54 +180,59 @@ jobs:
build/qbittorrent.pdb
dist/windows/qt.conf
ci_macos:
name: macOS + vcpkg
macos:
name: macOS
runs-on: macos-10.15
strategy:
matrix:
qbt_gui: ["GUI=ON", "GUI=OFF"]
fail-fast: false
runs-on: macos-10.15
defaults:
run:
shell: pwsh
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
# - ninja is needed for building qBittorrent (because it's preferable, not a hard requirement)
# - automake is needed for the installation the vcpkg installation of fontconfig, a dependency of qt5-base
- name: install additional required packages with homebrew
- name: Install build tools
shell: bash
run: |
brew install automake ninja
- name: setup vcpkg (cached, if possible)
- name: Setup vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgDirectory: ${{ env.VCPKG_DEST_MACOS }}
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
setupOnly: true
- name: configure vcpkg triplet overlay for release builds only
- name: Configure vcpkg triplet overlay
run: |
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
New-Item `
-Path ${{ github.workspace }} `
-Name "triplets_overlay" `
-ItemType Directory
Copy-Item `
${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
Add-Content ${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
Add-Content `
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
-Value "set(VCPKG_BUILD_TYPE release)","set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)"
# NOTE: Avoids a libtorrent ABI issue. See https://github.com/arvidn/libtorrent/issues/4965
- name: force AppleClang to compile libtorrent with the same C++ standard as qBittorrent
- name: Adjust "C++ standard" cmake flag
run: |
(Get-Content -path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake).Replace( `
(Get-Content `
-path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake).Replace( `
'${FEATURE_OPTIONS}', '${FEATURE_OPTIONS} -DCMAKE_CXX_STANDARD=17') `
| Set-Content -Path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake
- name: install dependencies via vcpkg
- name: Install dependencies
run: |
$packages = `
"boost-circular-buffer:x64-osx-release",
@ -232,10 +251,14 @@ jobs: @@ -232,10 +251,14 @@ jobs:
--clean-after-build
}
- name: build qBittorrent
- name: Build qBittorrent
shell: bash
run: |
cmake -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_MACOS }}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-osx-release \
-D${{ matrix.qbt_gui }} \
@ -243,7 +266,7 @@ jobs: @@ -243,7 +266,7 @@ jobs:
--graphviz=build/target_graph.dot
cmake --build build
- name: upload artifact as zip
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}

43
.github/workflows/coverity-scan.yml

@ -1,25 +1,22 @@ @@ -1,25 +1,22 @@
name: Coverity Scan
on:
schedule:
- cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
env:
LIBTORRENT_VERSION_TAG: v1.2.14
jobs:
coverity_scan:
name: Scan
runs-on: ubuntu-20.04
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
- name: install all build dependencies except libtorrent from Ubuntu repos
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
@ -29,24 +26,32 @@ jobs: @@ -29,24 +26,32 @@ jobs:
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
- name: install Qt 5.15.2 from an external PPA
- name: Install Qt
run: |
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
sudo apt install qt515base qt515svg qt515tools
sudo apt install \
qt515base qt515svg qt515tools
- name: install libtorrent from source
- name: Install libtorrent
run: |
git clone https://github.com/arvidn/libtorrent && cd libtorrent
git clone https://github.com/arvidn/libtorrent
cd libtorrent
git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
cmake -B cmake-build-dir -G "Ninja" \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-Ddeprecated-functions=OFF
cmake --build cmake-build-dir
sudo cmake --install cmake-build-dir --prefix /usr/local
cmake --build build
sudo cmake --install build --prefix /usr/local
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=qbittorrent%2FqBittorrent" -O coverity_tool.tgz
wget \
-q \
https://scan.coverity.com/download/linux64 \
--post-data "token=$TOKEN&project=qbittorrent%2FqBittorrent" \
-O coverity_tool.tgz
mkdir coverity_tool
tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
env:
@ -54,14 +59,16 @@ jobs: @@ -54,14 +59,16 @@ jobs:
- name: Configure qBittorrent
run: |
cmake -B build -G "Ninja" \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DGUI=ON \
-DVERBOSE_CONFIGURE=ON
- name: Build with cov-build
- name: Build qBittorrent
run: |
export PATH=`pwd`/coverity_tool/bin:$PATH
export PATH="$(pwd)/coverity_tool/bin:$PATH"
cov-build --dir cov-int cmake --build build
- name: Submit the result to Coverity Scan
@ -71,7 +78,7 @@ jobs: @@ -71,7 +78,7 @@ jobs:
--form token=$TOKEN \
--form email=sledgehammer999@qbittorrent.org \
--form file=@qbittorrent.tgz \
--form version="`git rev-parse --short HEAD`" \
--form version="$(git rev-parse --short HEAD)" \
--form description="master" \
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent
env:

12
.github/workflows/file_health.yaml

@ -1,22 +1,20 @@ @@ -1,22 +1,20 @@
name: GitHub Actions file health check
name: CI - File health
on: [pull_request, push]
jobs:
check_file_health:
name: Check file health
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
- name: install zsh
- name: Install tools
run: |
sudo apt update
sudo apt install zsh
- name: run check file health script
- name: Run script
run: |
./.github/workflows/file_health.sh

16
.github/workflows/webui_ci.yaml

@ -1,31 +1,31 @@ @@ -1,31 +1,31 @@
name: WebUI CI
name: CI - WebUI
on: [pull_request, push]
jobs:
check_webui:
name: Check WebUI
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/webui/www
steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v2
- name: setup nodejs
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: 'lts/*'
- name: install tools
- name: Install tools
run: npm install
- name: lint code
- name: Lint code
run: npm run lint
- name: format code
- name: Format code
run: |
npm run format
git diff --exit-code

Loading…
Cancel
Save