Run install_deps.py script when building containers weekly (#7384)

* Don't run CodeQL in PR draft

* Speed up analysis workflows

* Run install deps on Debian

* Add badge to readme

* Fixed copy and use workdir

* Use mount instead of copy

* Fixed unwanted && and changed workdir

* Split deps and deps-full

* Fixed context

* Use /app dir

* Use copy instead

* Revert to --mount and use .py (not .sh)

* Test

* Add `./scripts/install_deps.py` to all platforms

* Add missing syntax

* Fixed Python dep for OpenSUSE

* Temp remove WORKDIR for OpenSUSE

* Re-add workdir

* Increase timeout

* Delete `zypper --non-interactive remove busybox-which`

* Restore python3

* Test

* Rename to `lint-source-code`

* Beef up analysis runners

* Fixed workflow runs-on

* Use deps script

* Try pipx for gcovr

* Use containers with deps

* Add -y arg

* Install curl

* Merge deps step

* Add unzip dep

* Make Git dir safe

* Add .local/bin to env

* Improve step name

* Use `pipx ensurepath`

* Install gcovr with apt

* Use Ubuntu 22 with pip

* Update ChangeLog

* Use 16-core for Windows

* Use choco cache

* Test

* Use 8-core for Windows (picked up quicker, more available?)
This commit is contained in:
Nick Bolton 2024-07-11 15:26:38 +01:00 committed by GitHub
parent a4e1beb79d
commit 481680d072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 89 additions and 40 deletions

View file

@ -1,6 +1,17 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE
FROM $BASE_IMAGE AS base
RUN pacman -Syu --noconfirm git python sudo && pacman -Scc --noconfirm
FROM base AS deps
RUN pacman -Syu --noconfirm git python sudo && \
pacman -Scc --noconfirm
RUN useradd -m build
WORKDIR /app
RUN --mount=type=bind,target=/app,rw \
./scripts/install_deps.py && \
pacman -Scc --noconfirm

View file

@ -1,4 +1,17 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE
FROM $BASE_IMAGE AS base
RUN apt update && apt dist-upgrade -y && apt install -y git python3 && apt clean
FROM base AS deps
RUN apt update && \
apt dist-upgrade -y && \
apt install -y git python3 && \
apt clean
WORKDIR /app
RUN --mount=type=bind,target=/app,rw \
./scripts/install_deps.py && \
apt clean

View file

@ -1,4 +1,16 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE
FROM $BASE_IMAGE AS base
RUN dnf upgrade -y && dnf install -y git python3 && dnf clean all
FROM base AS deps
RUN dnf upgrade -y && \
dnf install -y git python3 && \
dnf clean all
WORKDIR /app
RUN --mount=type=bind,target=/app,rw \
./scripts/install_deps.py && \
dnf clean all

View file

@ -1,4 +1,17 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE
FROM $BASE_IMAGE AS base
RUN zypper refresh && zypper update -y && zypper install -y git python3 && zypper clean --all
FROM base AS deps
RUN zypper refresh && \
zypper update -y && \
zypper install -y git python3 && \
zypper clean --all
WORKDIR /app
RUN --mount=type=bind,target=/app,rw \
./scripts/install_deps.py && \
zypper clean --all

View file

@ -18,7 +18,7 @@ jobs:
name: ${{ matrix.os.name }}
runs-on: ${{ matrix.os.runs-on }}
if: ${{ vars.BUILD_CONTAINERS }}
timeout-minutes: 5
timeout-minutes: 10
strategy:
matrix:
@ -100,7 +100,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
context: ./.github/docker/${{ matrix.os.config-dir }}
context: .
file: ./.github/docker/${{ matrix.os.config-dir }}/Dockerfile
tags: symless/synergy-core:${{ matrix.os.name }}
build-args: BASE_IMAGE=${{ matrix.os.base-image }}

View file

@ -46,7 +46,7 @@ jobs:
matrix:
target:
- name: windows-2022-x64
runs-on: windows-2022
runs-on: windows-2022-8-core-x64
steps:
- name: Checkout
@ -54,6 +54,12 @@ jobs:
with:
submodules: "recursive"
- name: Cache Chocolatey packages
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/choco
key: choco-${{ hashFiles('Chocolatey.config') }}
- name: Install dependencies
run: python ./scripts/install_deps.py
@ -61,14 +67,12 @@ jobs:
run: python ./scripts/github_env.py --set-qt-version
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
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: python ./scripts/install_deps.py --only qt
- name: Setup VC++ environment

View file

@ -17,8 +17,11 @@ concurrency:
jobs:
analyze:
if: ${{ !github.event.pull_request.draft }}
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-16-core-x64
container: symless/synergy-core:ubuntu-24.04-amd64
timeout-minutes: 20
strategy:
@ -27,29 +30,16 @@ jobs:
language: ["cpp"]
steps:
- name: Install dependencies
run: |
sudo apt-get update; \
sudo apt-get install -y \
build-essential \
cmake \
debhelper \
devscripts \
git \
libavahi-compat-libdnssd-dev \
libgdk-pixbuf2.0-dev \
libgl1-mesa-dev \
libglib2.0-dev \
libnotify-dev \
libssl-dev \
libx11-dev \
libxtst-dev \
qtbase5-dev \
qttools5-dev \
qttools5-dev-tools
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Checkout git repo
uses: actions/checkout@v3
- name: Config Git safe dir
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Install dependencies
run: ./scripts/install_deps.py
- name: Initialize CodeQL
uses: github/codeql-action/init@v3

View file

@ -12,7 +12,7 @@ on:
- ready_for_review
jobs:
lint-cmake-files:
lint-source-code:
runs-on: ubuntu-latest
timeout-minutes: 5

View file

@ -18,7 +18,9 @@ concurrency:
jobs:
sonarcloud-analysis:
if: ${{ vars.SONAR_SCANNER_ENABLED }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-16-core-x64
container: symless/synergy-core:ubuntu-22.04-amd64
timeout-minutes: 20
env:
@ -30,13 +32,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- name: Config Git safe dir
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Install dependencies
run: ./scripts/install_deps.py
- name: Install gcovr
run: pip install gcovr
run: |
./scripts/install_deps.py &&
apt install curl unzip -y &&
pip install gcovr
- name: Install SonarScanner
run: |

View file

@ -50,6 +50,7 @@ Enhancements:
- #7380 Add `qt6-qpa-plugins` Qt dependency for Debian
- #7381 Set macOS min version to macOS 12.0
- #7382 Re-run `macdeployqt6` to copy missing Qt 6 dependencies
- #7384 Run `install_deps.py` script when building containers weekly
# 1.14.6

View file

@ -3,6 +3,7 @@
[![CI](https://github.com/symless/synergy-core/actions/workflows/ci.yml/badge.svg)](https://github.com/symless/synergy-core/actions/workflows/ci.yml)
[![CodeQL Analysis](https://github.com/symless/synergy-core/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/symless/synergy-core/actions/workflows/codeql-analysis.yml)
[![SonarCloud Analysis](https://github.com/symless/synergy-core/actions/workflows/sonarcloud-analysis.yml/badge.svg)](https://github.com/symless/synergy-core/actions/workflows/sonarcloud-analysis.yml)
[![Build containers](https://github.com/symless/synergy-core/actions/workflows/build-containers.yml/badge.svg)](https://github.com/symless/synergy-core/actions/workflows/build-containers.yml)
This is the open source core component of Synergy, a keyboard and mouse sharing tool.

View file

@ -66,7 +66,6 @@ config:
opensuse-tumbleweed: &opensuse-tumbleweed
dependencies:
command: sudo zypper refresh; \
sudo zypper --non-interactive remove busybox-which; \
sudo zypper install -y --force-resolution \
cmake \
make \