Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Simplify compile options and use comprehensive edition logic (deskflo…
Browse files Browse the repository at this point in the history
…w#7365)

* Simplify options

* Use more sensible edition logic

* Use set instead of option for string

* Improve macro for product name

* Add tests launch config

* Restore unregistered state

* Reorganize cases for title and improve function name

* Code coverage on by default

* Fixed copyright

* Improve code coverage and test readability

* Separate build-all and build-coverage

* Back out coverage on by default

* Fixed bad var in cmake

* More verbose logging for coverage

* Restore tasks

* Restore preLaunchTask

* Use default comparitor

* Move temp files to temp dir

* Add tasks for tests

* Support for wstring

* Upgrade sonar-scanner to 6 on Debian 12

* Use modern pip install

* Install python for sonarcloud

* Use Ubuntu and install deps

* Fixed sonar-scanner URL

* Fix exported dir

* Persist build dir

* Don't use venv for pip install gcovr

* Fixed another path

* Update actions/checkout to v4 for SonarCloud analysis workflow

* Add coverage task

* Improve coverage for SerialKeyEdition.cpp

* Enable licensing for builds

* Fixed invalid macro names, missing arguments, etc

* Fixed more copyright

* Fixed incorrect use of "enterprise"

* Fixed incorrect use of "business"

* Experiment with environment

* Make package prefix variable

* Add environment matrix to all OS

* Improve job names

* Make job names easier to read

* Roll back environment matrix (too much noise)

* Fixed: default should override required

* Refactor CI with vars

* Fixed arg for env.get_env
  • Loading branch information
nbolton authored Jul 4, 2024
1 parent 37bb0f9 commit 4690b61
Show file tree
Hide file tree
Showing 46 changed files with 527 additions and 481 deletions.
56 changes: 33 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,30 @@ on:

env:
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
SYNERGY_ENABLE_LICENSING: ${{ vars.SYNERGY_ENABLE_LICENSING }}
PACKAGE_BUILD: ${{ !github.event.pull_request.draft }}
PACKAGE_UPLOAD: ${{ !github.event.pull_request.draft && github.event_name != 'schedule' }}
UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }}

jobs:
windows:
name: windows-2022
runs-on: windows-2022
name: ${{ matrix.target.name }}
runs-on: ${{ matrix.target.runs-on }}
timeout-minutes: 20

env:
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt

strategy:
matrix:
target:
- name: windows-2022
runs-on: windows-2022
arch: x64

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -75,48 +85,48 @@ jobs:
run: ./build/bin/unittests

- name: Package
if: ${{ env.PACKAGE_BUILD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
run: python ./scripts/package.py
env:
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}

- name: Upload
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
github-target-filename: "synergy-windows-x64"
gdrive-target-base-dir: "synergy1/personal"
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-windows-${{ matrix.target.name }}"
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
package-version: ${{ env.SYNERGY_VERSION }}

macos:
runs-on: ${{ matrix.runtime.os }}
timeout-minutes: ${{ matrix.runtime.timeout }}
name: ${{ matrix.runtime.name }}
name: ${{ matrix.target.name }}
runs-on: ${{ matrix.target.os }}
timeout-minutes: ${{ matrix.target.timeout }}

defaults:
run:
shell: ${{ matrix.runtime.shell }}
shell: ${{ matrix.target.shell }}

strategy:
matrix:
runtime:
target:
- name: "macos-11-arm64"
timeout: 10
os: "macos-14"
arch: arm64
target: "11"
version: "11"
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"

- name: "macos-10-intel"
timeout: 20
os: "macos-14-large"
arch: x64
target: "10.14"
version: "10.14"
shell: "bash"

steps:
Expand All @@ -130,7 +140,7 @@ jobs:

- name: Configure
env:
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.target.version }}
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)

- name: Build
Expand All @@ -140,7 +150,7 @@ jobs:
run: ./build/bin/unittests

- name: Package
if: ${{ env.PACKAGE_BUILD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
run: ./scripts/package.py
env:
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
Expand All @@ -151,21 +161,21 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: Upload
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
github-target-filename: "synergy-${{ matrix.runtime.name }}"
gdrive-target-base-dir: "synergy1/personal"
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-${{ matrix.target.name }}"
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
package-version: ${{ env.SYNERGY_VERSION }}

linux:
name: linux-${{ matrix.distro.name }}
runs-on: ${{ matrix.distro.runs-on }}
timeout-minutes: 10
name: linux-${{ matrix.distro.name }}
container: ${{ matrix.distro.container }}

env:
Expand Down Expand Up @@ -265,20 +275,20 @@ jobs:
run: ./build/bin/unittests

- name: Package
if: ${{ env.PACKAGE_BUILD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
env:
LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }}
LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }}
run: ./scripts/package.py

- name: Upload
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
github-target-filename: "synergy-${{ matrix.distro.name }}"
gdrive-target-base-dir: "synergy1/personal"
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-${{ matrix.distro.name }}"
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
package-version: ${{ env.SYNERGY_VERSION }}
36 changes: 19 additions & 17 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,55 @@ concurrency:

jobs:
sonarcloud-analysis:
if: ${{ vars.SONAR_SCANNER_ENABLED }}
runs-on: ubuntu-latest
container: symless/synergy-core:debian10
timeout-minutes: 20

env:
SONAR_SCANNER_VERSION: 5.0.1.3006
SONAR_SCANNER_VERSION: 6.1.0.4477
SONAR_SCANNER_OPTS: -server
SONAR_SCANNER_URL_BASE: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli

steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Installing gcovr
run: |
apt-get update
apt-get install -y python python-pip
pip install gcovr
- name: Install dependencies
run: ./scripts/install_deps.py

- name: Install gcovr
run: pip install gcovr

- name: Installing Sonar Scanner
- name: Install SonarScanner
run: |
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
$SONAR_SCANNER_URL_BASE/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- name: Installing build-wrapper
- name: Install build-wrapper
run: |
curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
- name: Build
run: |
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
mkdir build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
build-wrapper-linux-x86-64 --out-dir bw-output make -j
- name: Running coverage
- name: Make coverage
run: |
cd build
make coverage
- name: Run Sonar Scanner
- name: Run SonarScanner
run: |
export PATH=$HOME/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:$PATH
export PATH=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64/bin:$PATH
cd build
sonar-scanner \
-Dsonar.organization=symless \
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cpptools",
"vadimcn.vscode-lldb",
"cheshirekow.cmake-format"
"cheshirekow.cmake-format",
"jacqueslucke.gcov-viewer"
]
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
"program": "${workspaceFolder}/build/bin/synergy",
"preLaunchTask": "build"
},
{
"name": "unittests lldb",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/bin/unittests",
"preLaunchTask": "build"
},
{
"name": "integtests lldb",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/bin/integtests",
"preLaunchTask": "build"
},
{
"name": "win daemon attach",
"type": "cppvsdbg",
Expand Down
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,31 @@
"isDefault": true
}
},
{
"type": "cmake",
"label": "coverage",
"command": "build",
"targets": ["coverage"],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build"
},
{
"label": "reinstall windows daemon",
"type": "shell",
"command": "python scripts/windows_daemon.py",
"dependsOn": ["build"]
},
{
"label": "unittests",
"type": "shell",
"command": "./build/bin/unittests",
"dependsOn": ["build"]
},
{
"label": "integtests",
"type": "shell",
"command": "./build/bin/integtests",
"dependsOn": ["build"]
}
]
}
20 changes: 10 additions & 10 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Enhancements:
- #7190 Maintenance license serial key support
- #7193 Support for maintenance licenses in China
- #7197 Special contributor mentions on the about screen
- #7203 License registration for Business edition
- #7203 License registration for more editions
- #7210 Update macos workflow to use macos-latest
- #7213 Update azure pipelines to use macos-latest

Expand All @@ -87,8 +87,8 @@ Bug fixes:
Enhancements:

- #7143 Ability to stop Synergy on the login screen
- #7157 Synergy Business accepts only business licenses
- #7188 Synergy Basic\Pro accepts business licenses
- #7157 Only accept correct license for specific edition
- #7188 Only accept correct license for personal edition
- #7166 Replace language notifications with warnings in logs
- #7181 Fedora 36 support to CI system
- #7177 Create workflow for flatpak build support
Expand Down Expand Up @@ -127,7 +127,7 @@ Bug fixes:
- #7096 The system duplicates hotkeys in setup
- #7099 Compilation broken with msvc 2014
- #7100 No configuration available on Windows
- #7097 The title "Enterprise" disappeares after clicking on "Preferences"
- #7097 Title disappeares after clicking on "Preferences"
- #7108 Wrong characters on client for unicode
- #7114 Problem with reading languages on Linux system
- #7115 Prevent notifications if language reading fails
Expand Down Expand Up @@ -279,9 +279,9 @@ Bug fixes:

- #6831 Incorporating Sonar's major
- #6837 Memory leaks on macOS system
- #6838 Enterprise asks for serial key on Linux system
- #6838 Serial key requested by mistake
- #6849 Auto-hide resets itself
- #6846 TLS certificate is not created by default for Synergy Enterprise.
- #6846 TLS certificate is not created by default
- #6859 Systray Icon on Ubuntu Auto Start
- #6863 Adding MacOS CI Build Steps for Homebrew Cleanup

Expand All @@ -307,7 +307,7 @@ Bug fixes:
- #6804 Synergy loses edition when creating a System scope config
- #6660 + #6582 Add missing XAtom for utf-8 handling with Xorg
- #6814 The system asks to save twice.
- #6817 Configure requires dns_sd.h for enterprise version
- #6817 Configure requires dns_sd.h
- #6826 + #6829 SonarCloud Critical bugs
- #6821 Blocker bugs found by sonar in synergy and in tests
- #6825 The system requires google test even when tests are disabled with BUILD_TESTS=OFF
Expand All @@ -318,7 +318,7 @@ Enhancements:

- #6750 Integrate SonarCloud for static analysis and test coverage
- #6792 License key expiry
- #6799 Synergy "Business" edition
- #6799 New edition
- #6803 Update Synergy icons
- #6800 Update behaviour when unregistered
- #6806 Move to Github Action for general PR builds and tests
Expand Down Expand Up @@ -430,7 +430,7 @@ Bug fixes:
- #6495 Event queue memory leak in server cleanup
- #6471 Unable to stop core retry loop in config app
- #6460 TLS memory leak on Linux server when using client
- #6407 Enterprise config app shows auto-config elements
- #6407 Config app shows auto-config elements
- #6403 Mouse cursor movement drifts over time
- #6392 Hostname alert shows unnecessarily on every open
- #6373 Compile fails on BSD Unix with dl error
Expand Down Expand Up @@ -479,7 +479,7 @@ Enhancements:
- #6312 Removal of redundant CURL library
- #6306 Show version number in config app title
- #6305 Support for Raspbian in package config
- #6301 Combine enterprise and community codebases
- #6301 Combine codebases for all editions

# 1.9.1

Expand Down
Loading

0 comments on commit 4690b61

Please sign in to comment.