From 7398f64d515ceec4789deacde2e2ecff5175d8bc Mon Sep 17 00:00:00 2001 From: pml68 Date: Mon, 16 Jun 2025 01:07:04 +0200 Subject: ci: separate `Lint` and `Test` workflows --- .github/workflows/build.yml | 4 ++-- .github/workflows/ci.yml | 28 ---------------------------- .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ Cargo.toml | 13 +++++++++---- 5 files changed, 63 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 978f334..6efda6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,10 +30,10 @@ jobs: target/ key: ${{ runner.os }}-build-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }} - name: Build iced-builder binary - run: cargo build --verbose --release + run: cargo build --verbose --profile release-opt - name: Archive iced-builder binary if: matrix.rust-version == 'stable' uses: actions/upload-artifact@v4 with: name: iced-builder-x86_64-unknown-linux-gnu - path: target/ci/iced-builder + path: target/release-opt/iced-builder diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e2316f3..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: CI -on: [push, pull_request] -jobs: - ci: - runs-on: ubuntu-latest - steps: - - uses: hecrj/setup-rust-action@v2 - with: - components: clippy - - uses: actions/checkout@master - - name: Install dependencies - run: | - export DEBIAN_FRONTED=noninteractive - sudo apt-get -qq update - sudo apt-get install -y libxkbcommon-dev clang mold - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-ci-${{ hashFiles('**/Cargo.lock') }} - - name: Check lints - run: cargo lint - - name: Run tests - run: cargo test --verbose --profile ci diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..073b5e9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint +on: [push, pull_request] +jobs: + all: + runs-on: ubuntu-latest + steps: + - uses: hecrj/setup-rust-action@v2 + with: + components: clippy + - uses: actions/checkout@master + - name: Install dependencies + run: | + export DEBIAN_FRONTED=noninteractive + sudo apt-get -qq update + sudo apt-get install -y libxkbcommon-dev clang mold + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-ci-${{ hashFiles('**/Cargo.lock') }} + - name: Check lints + run: cargo lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..89cabd3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test +on: [push, pull_request] +jobs: + all: + runs-on: ubuntu-latest + env: + RUSTFLAGS: --deny warnings + steps: + - uses: hecrj/setup-rust-action@v2 + - uses: actions/checkout@master + - name: Install dependencies + run: | + export DEBIAN_FRONTED=noninteractive + sudo apt-get -qq update + sudo apt-get install -y libxkbcommon-dev clang mold + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-ci-${{ hashFiles('**/Cargo.lock') }} + - name: Run tests + run: cargo test --verbose --workspace -- --ignored diff --git a/Cargo.toml b/Cargo.toml index 2adda8b..fe74a96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,10 +55,6 @@ windows_exe_info = "0.5" [profile.dev] opt-level = 1 -[profile.ci] -inherits = "dev" -opt-level = 0 - [profile.dev.package."*"] opt-level = 3 @@ -66,6 +62,15 @@ opt-level = 3 lto = true strip = true +[profile.release-opt] +inherits = "release" +codegen-units = 1 +debug = false +incremental = false +opt-level = 3 +overflow-checks = false +strip = "debuginfo" + [[bin]] name = "iced-builder" path = "src/main.rs" -- cgit v1.2.3