From ea98cf602b5f0c1692d0dbcaea0c35060ed35391 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 23 Mar 2025 16:07:59 +0100 Subject: ci: add caching, use mold for linking --- .cargo/config.toml | 6 +++--- .github/workflows/build.yml | 13 +++++++++++-- .github/workflows/ci.yml | 15 ++++++++++++--- Cargo.toml | 8 ++++++++ PKGBUILD | 10 +++++++--- 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index e0aa01f..80a170c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,9 +2,9 @@ lint = "clippy --no-deps -- -D warnings" lint-all = "clippy --no-deps -- -D clippy::pedantic" -# [target.x86_64-unknown-linux-gnu] -# linker = "clang" -# rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] +[target.x86_64-unknown-linux-gnu] +linker = "clang" +rustflags = ["-C", "link-arg=-fuse-ld=mold"] # [build] # rustflags = ["-Z", "threads=6"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0af166..25b4c6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,18 @@ jobs: run: | export DEBIAN_FRONTED=noninteractive sudo apt-get -qq update - sudo apt-get install -y libxkbcommon-dev libgtk-3-dev + sudo apt-get install -y libxkbcommon-dev libgtk-3-dev clang mold + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build iced-builder binary - run: cargo build --verbose --release + run: cargo build --verbose --profile ci - name: Archive iced-builder binary if: matrix.rust-version == 'stable' uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eba27cf..97439df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,17 @@ jobs: run: | export DEBIAN_FRONTED=noninteractive sudo apt-get -qq update - sudo apt-get install -y libxkbcommon-dev libgtk-3-dev + sudo apt-get install -y libxkbcommon-dev libgtk-3-dev clang mold + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Check lints - run: cargo lint + run: cargo lint --profile ci - name: Run tests - run: cargo test --verbose + run: cargo test --verbose --profile ci diff --git a/Cargo.toml b/Cargo.toml index 6110c21..8702fc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,10 @@ categories = ["gui"] keywords = ["gui", "ui", "graphics", "interface", "widgets"] rust-version = "1.85.0" +[features] +default = [] +debug = ["iced/debug"] + [dependencies] iced.workspace = true iced_anim = { git = "https://github.com/pml68/iced_anim", features = ["derive"] } @@ -44,6 +48,10 @@ windows_exe_info = "0.4" [profile.dev] opt-level = 1 +[profile.ci] +inherits = "dev" +opt-level = 0 + [profile.dev.package."*"] opt-level = 3 diff --git a/PKGBUILD b/PKGBUILD index 073c1cb..dcf6adf 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=iced-builder _pkgver=0.1.0 -pkgver=0.1.0.g256e3ba +pkgver=0.1.0.g5583c7a pkgrel=1 pkgdesc='UI builder for iced, built with iced.' arch=(x86_64) @@ -12,13 +12,12 @@ depends=( gcc-libs glibc gtk3 - rustfmt ) makedepends=( git cargo ) -options=('!lto' '!debug') +options=('!lto' '!strip' '!debug') source=("$pkgname::git+${url}.git") sha256sums=('SKIP') @@ -43,7 +42,12 @@ build() { } package() { + depends=( + rustfmt + ) + cd "${pkgname}" install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } -- cgit v1.2.3