Fixes Linux CI build failure by updating rfd to 0.17 #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master, dev] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| # Faster compilation with incremental disabled for CI | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| # ============================================ | |
| # Format Check - Fast, runs first | |
| # ============================================ | |
| format: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| # ============================================ | |
| # Lint - Clippy analysis | |
| # ============================================ | |
| lint: | |
| name: Lint (Clippy) | |
| runs-on: ubuntu-latest | |
| needs: format | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "lint" | |
| - name: Install Linux dependencies | |
| 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 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: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: format | |
| 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: "test-${{ 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: Run cargo check | |
| run: cargo check --all-targets | |
| - name: Run tests | |
| run: cargo test --all-features -- --nocapture | |
| env: | |
| 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 | |
| # ============================================ | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| needs: format | |
| 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: "docs" | |
| - name: Install Linux dependencies | |
| 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: Build documentation | |
| run: cargo doc --no-deps --all-features | |
| env: | |
| RUSTDOCFLAGS: -D warnings |