Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine workflows into one CI workflow (original) #7295

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches: [master/*, release/*]

jobs:
test-windows:
runs-on: windows-latest
timeout-minutes: 20

env:
GIT_COMMIT: ${{ github.sha }}
BONJOUR_BASE_DIR: ${{ github.workspace }}\deps\bonjour
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
QT_VERSION: 5.12.6
QT_BASE_URL: http://qt.mirror.constant.com/
QT_LIB_DIR: ${{ github.workspace }}\deps\Qt\5.12.6

steps:
- uses: actions/checkout@v3

- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ${{ env.QT_BASE_DIR }}
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}

- name: Install Qt
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
pip install aqtinstall
python -m aqt install --outputdir $env:QT_BASE_DIR --base $env:QT_BASE_URL $env:QT_VERSION windows desktop win64_msvc2017_64
cd $env:QT_LIB_DIR\msvc2017_64
dir

- name: Cache Bonjour
id: cache-bonjour
uses: actions/cache@v1
with:
path: ${{ env.BONJOUR_BASE_DIR }}
key: ${{ runner.os }}-Bonjour

- name: Install Bonjour SDK
if: steps.cache-bonjour.outputs.cache-hit != 'true'
run: |
New-Item -Force -ItemType Directory -Path "$env:BONJOUR_BASE_DIR"
$client = new-object System.Net.WebClient
$client.DownloadFile("https://binaries.symless.com/bonjour/BonjourSDK.zip",".\bonjoursdk.zip")
[System.IO.Compression.ZipFile]::ExtractToDirectory(".\bonjoursdk.zip", "$env:BONJOUR_BASE_DIR")

- name: Install dependencies
run: python ./scripts/install_deps.py --skip cmake ninja

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Build
env:
CMAKE_PREFIX_PATH: "${{ env.QT_LIB_DIR }}\\msvc2017_64\\"
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
. ./version
msbuild synergy-core.sln /p:Configuration=Release

- name: Run unit test
run: .\build\bin\Release\unittests.exe

test-macos:
runs-on: ${{ matrix.runtime.os }}
timeout-minutes: 10

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

strategy:
matrix:
runtime:
- name: "macos-10-intel"
os: "macos-latest"
arch: x64
target: "10.14"
shell: "bash"
- name: "macos-11-m1"
os: "macos-latest-xlarge"
arch: arm64
target: "11"
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"

env:
GIT_COMMIT: ${{ github.sha }}

steps:
- name: Setup PATH
run: |
case "$ARCH" in
"arm64")
echo "/opt/homebrew/bin" >> $GITHUB_PATH
;;
esac
env:
ARCH: ${{ matrix.runtime.arch }}

- name: Checkout git repo
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Install brew dependencies
run: brew bundle --file=- <<< "brew 'qt5'; brew 'openssl'"

- name: Build
env:
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5);$(brew --prefix openssl)" ..
. ./version
make -j

- name: Run unit test
run: ./build/bin/unittests

test-linux:
runs-on: ubuntu-latest
timeout-minutes: 10
container: symless/synergy-core:${{ matrix.distro }}
env:
GIT_COMMIT: ${{ github.sha }}
strategy:
matrix:
distro:
- centos7.6
- centos8
- debian9
- debian10
- debian11
- debiansid
- fedora33
- fedora34
- fedora35
- fedora36
- fedora37
- fedora38
- ubuntu18.04
- ubuntu20.04
- ubuntu22.04
- ubuntu22.10
flag: ["-j"]
include:
- distro: "ubuntu16.04"
flag: "-j1"

name: test-linux-${{ matrix.distro }}

steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
. ./version
make ${{ matrix.flag }}

- name: Run unit test
run: ./build/bin/unittests
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

jobs:
analyze:
if: ${{ !env.ACT }}
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/job-test-linux-centos.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/job-test-linux-debian.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/job-test-linux-fedora.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/job-test-linux-ubuntu.yml

This file was deleted.

Loading
Loading