Skip to content
Merged
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
142 changes: 10 additions & 132 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: CI

on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master, dev]
branches: [main, dev]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Faster compilation with incremental disabled for CI
CARGO_INCREMENTAL: 0

jobs:
Expand Down Expand Up @@ -74,40 +77,17 @@ jobs:
libx11-xcb-dev \
libxml2-dev

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-lint-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-lint-

- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
continue-on-error: true

# ============================================
# Test - Run on all platforms
# Test - Linux only (cross-platform in release)
# ============================================
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
name: Test
runs-on: ubuntu-latest
needs: format
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -118,10 +98,9 @@ jobs:
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "test-${{ matrix.os }}"
shared-key: "test"

- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
Expand All @@ -143,26 +122,6 @@ jobs:
libx11-xcb-dev \
libxml2-dev

- name: Cache vcpkg
if: matrix.os == 'windows-latest'
uses: actions/cache@v4
with:
path: C:\vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
${{ runner.os }}-vcpkg-

- name: Install Windows dependencies (vcpkg)
if: matrix.os == 'windows-latest'
run: |
if (!(Test-Path C:\vcpkg)) {
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
}
C:\vcpkg\vcpkg install libxml2:x64-windows
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
echo "C:\vcpkg\installed\x64-windows\bin" >> $env:GITHUB_PATH

- name: Run cargo check
run: cargo check --all-targets

Expand All @@ -172,87 +131,6 @@ jobs:
LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:${{ github.workspace }}/target/debug/build
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libxml2.so.2

# ============================================
# Build - Verify release builds work
# ============================================
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [lint, test]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "build-${{ matrix.os }}"

- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libssl-dev \
libgtk-3-dev \
libglib2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libpango1.0-dev \
libgdk-pixbuf2.0-dev \
libwayland-dev \
libxcb1-dev \
libxcb-randr0-dev \
libxcb-xkb-dev \
libx11-xcb-dev \
libxml2-dev

- name: Cache vcpkg
if: matrix.os == 'windows-latest'
uses: actions/cache@v4
with:
path: C:\vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
${{ runner.os }}-vcpkg-

- name: Install Windows dependencies (vcpkg)
if: matrix.os == 'windows-latest'
run: |
if (!(Test-Path C:\vcpkg)) {
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
}
C:\vcpkg\vcpkg install libxml2:x64-windows
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
echo "C:\vcpkg\installed\x64-windows\bin" >> $env:GITHUB_PATH

- name: Build release binary
run: cargo build --release

- name: Verify binary exists (Unix)
if: matrix.os != 'windows-latest'
run: |
ls -la target/release/ultralog
file target/release/ultralog

- name: Verify binary exists (Windows)
if: matrix.os == 'windows-latest'
run: |
dir target\release\ultralog.exe

# ============================================
# Documentation - Verify docs build
# ============================================
Expand Down
Loading