Skip to content

Prepare InputFlow for production release #52

Prepare InputFlow for production release

Prepare InputFlow for production release #52

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
jobs:
ubuntu-build:
name: Ubuntu build and tests
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Install dependencies
run: |
# Drop pre-installed third-party repos (Microsoft/azure) that
# intermittently 403 and break apt-get update; we only need Ubuntu's.
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list \
/etc/apt/sources.list.d/azure-cli.list \
/etc/apt/sources.list.d/microsoft*.list || true
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
ccache \
cmake \
ninja-build \
libx11-dev \
libssl-dev \
pkg-config \
zlib1g-dev
- name: Configure
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Package and smoke-test portable archive
run: |
cmake --build build --target package
archive="$(find build -maxdepth 1 -name 'inputflow-*.tar.gz' -print -quit)"
tests/test_portable_archive.sh "$archive"
- name: Compiler cache stats
run: ccache --show-stats
fedora-build:
name: Fedora build and tests
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install dependencies
run: |
dnf install -y --setopt=install_weak_deps=False \
ccache \
cmake \
gcc-c++ \
git \
gtk3-devel \
libayatana-appindicator3-devel \
libX11-devel \
make \
ninja-build \
openssl-devel \
pkgconf-pkg-config \
rpm-build \
systemd-rpm-macros \
zlib-devel
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Validate RPM packaging, build, and tests
run: |
MWB_VALIDATE_RPM_BUILD=1 \
MWB_RPM_CMAKE_EXTRA_ARGS="-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" \
scripts/validate-rpm-packaging.sh
- name: Compiler cache stats
run: ccache --show-stats
sanitizers:
name: ASan and UBSan
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Install dependencies
run: |
# Drop pre-installed third-party repos (Microsoft/azure) that
# intermittently 403 and break apt-get update; we only need Ubuntu's.
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list \
/etc/apt/sources.list.d/azure-cli.list \
/etc/apt/sources.list.d/microsoft*.list || true
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
ccache \
cmake \
ninja-build \
libx11-dev \
libssl-dev \
pkg-config \
zlib1g-dev
- name: Configure
run: cmake -S . -B build-sanitize -G Ninja -DCMAKE_BUILD_TYPE=Debug -DMWB_ENABLE_SANITIZERS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build-sanitize --parallel
- name: Test
run: ctest --test-dir build-sanitize --output-on-failure
- name: Compiler cache stats
run: ccache --show-stats
static-checks:
name: Static checks
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Check trailing whitespace
run: |
if git grep -nI '[[:blank:]]$' -- .; then
echo "Trailing whitespace found"
exit 1
fi
- name: Check shell syntax
run: |
bash -n mwb-desktop-ui.sh
bash -n scripts/inputflow-diagnostics-bundle.sh
bash -n scripts/release-gate.sh
bash -n scripts/validate-rpm-packaging.sh
bash -n tests/test_diagnostics_privacy.sh
bash -n tests/test_portable_archive.sh
python3 -m py_compile scripts/generate-release-metadata.py
- name: Verify diagnostics privacy
run: tests/test_diagnostics_privacy.sh scripts/inputflow-diagnostics-bundle.sh
- name: Validate RPM packaging skeleton
run: scripts/validate-rpm-packaging.sh
android-build:
name: Android build and unit tests
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Build release APK, run unit tests, and enforce lint
working-directory: android
run: |
./gradlew :app:assembleRelease :app:testDebugUnitTest :app:lintRelease --no-daemon --stacktrace