From 90f5d31859fd0493ec4d06a803bb71ccbe3c7970 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 19:31:18 +0100 Subject: [PATCH 01/10] ci: update actions --- .github/workflows/pull-request.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3fd8bac2c..4b9120df1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -7,7 +7,7 @@ jobs: name: Check Commit Message runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # A PR should not contain too many commits fetch-depth: 10 @@ -18,14 +18,3 @@ jobs: chmod +x convco ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} rm convco - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt \ No newline at end of file From 4ac4a106ba3f6abb18cd9c42acbde44559c94dcb Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 19:31:38 +0100 Subject: [PATCH 02/10] ci: matrixify linux builds --- .github/workflows/ci.yml | 227 +++++++++------------------------------ 1 file changed, 49 insertions(+), 178 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba4555cc9..3840605c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,202 +6,73 @@ on: pull_request: jobs: - linux_dbus: - name: linux (dbus) + check_commit: + name: Check Commit Message runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - 1.70.0 steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - run: sudo apt-get install -y libdbus-1-dev - - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features d - - - name: test - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features d - - - name: doc_test - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features d - - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --no-default-features --features d -- -D warnings - - linux_dbus_with_image_feature: - name: linux (dbus + image) + - uses: actions/checkout@v4 + with: + # A PR should not contain too many commits + fetch-depth: 10 + - name: Validate commit messages + run: | + git show-ref + curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco + chmod +x convco + ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} + rm convco + + linux: + name: linux + needs: check_commit runs-on: ubuntu-latest strategy: matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 8 releases + feature: + - d + - d,images + - z + - z,images + - z,d steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy + components: clippy, rustfmt - run: sudo apt-get install -y libdbus-1-dev - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features d,images - - - name: test_features_images - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features d,images - - - name: doc_test_features_images - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features d,images - - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --no-default-features --features d,images -- -D warnings - - linux_zbus: - name: linux (zbus) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - 1.70.0 - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features z + - name: check (default features) + run: cargo check - - name: test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features z + - name: cargo-fmt + run: cargo fmt --all --check - - name: doc_test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features z + - name: check (${{matrix.feature}}) + run: cargo check --no-default-features --features ${{matrix.feature}} - linux_zbus_with_image_feature: - name: linux (zbus + image) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - 1.70.0 - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy + - name: test (default features) + run: cargo test - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features z,images + - name: test lib (${{matrix.feature}}) + run: cargo test --lib --no-default-features --features ${{matrix.feature}} - - name: test_features_images (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features z,images + - name: test tests (${{matrix.feature}}) + run: cargo test --tests --no-default-features --features ${{matrix.feature}} - - name: doctest_features_images (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features z,images + - name: test docs (${{matrix.feature}}) + run: cargo test --doc --no-default-features --features ${{matrix.feature}} - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --no-default-features --features z,images -- -D warnings - - linux_zbus_and_dbus: - name: linux (zbus and dbus) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - 1.70.0 - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - run: sudo apt-get install -y libdbus-1-dev - - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features z,d - - - name: test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features z,d - - - name: doc_test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features z,d + - name: clippy (default features) + run: cargo clippy + - name: clippy (${{matrix.feature}}) + run: cargo clippy --no-default-features --features ${{matrix.feature}} -- -D warnings windows: name: windows @@ -212,7 +83,7 @@ jobs: - stable - 1.70.0 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -243,7 +114,7 @@ jobs: - stable - 1.70.0 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal From eaa1e5871a0006748187e4f8c1ab66556afcd003 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 19:46:29 +0100 Subject: [PATCH 03/10] ci: check commit message before anything else --- .github/workflows/ci.yml | 3 +++ .github/workflows/pull-request.yml | 20 -------------------- 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3840605c8..89bf413ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,7 @@ jobs: windows: name: windows + needs: check_commit runs-on: windows-latest strategy: matrix: @@ -107,6 +108,7 @@ jobs: macos: name: macos + needs: check_commit runs-on: macos-latest strategy: matrix: @@ -135,3 +137,4 @@ jobs: with: command: clippy args: -- -D warnings +t a \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml deleted file mode 100644 index 4b9120df1..000000000 --- a/.github/workflows/pull-request.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Pull request -# This workflow is triggered on pushes to the repository. -on: [ pull_request ] - -jobs: - check: - name: Check Commit Message - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - # A PR should not contain too many commits - fetch-depth: 10 - - name: Validate commit messages - run: | - git show-ref - curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco - chmod +x convco - ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} - rm convco From 1c907ff23e4117029c59e6647529662e310b7d7f Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:06:20 +0100 Subject: [PATCH 04/10] ci: simplify mac and windows builds --- .github/workflows/ci.yml | 68 +++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89bf413ad..2e7ba7b7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,29 +82,25 @@ jobs: matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 8 releases steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - - name: test - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-run - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + components: clippy, rustfmt + + - name: check (default features) + run: cargo check + + - name: test (default features) + run: cargo test --no-run + + - name: clippy (default features) + run: cargo clippy -- -D warnings + macos: name: macos @@ -114,27 +110,21 @@ jobs: matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 8 releases steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - - run: rustup component add clippy - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - - name: test - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-run - - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings -t a \ No newline at end of file + components: clippy, rustfmt + + - name: check (default features) + run: cargo check + + - name: test (default features) + run: cargo test --no-run + + - name: clippy (default features) + run: cargo clippy -- -D warnings From d94772bec469de2ab47476422985a72476679923 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:10:19 +0100 Subject: [PATCH 05/10] ci: check fmt only once --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e7ba7b7a..7bc7f40c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,17 @@ jobs: ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} rm convco + check_fmt: + name: Check Format + needs: check_commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + + - name: cargo-fmt + run: cargo fmt --all --check + linux: name: linux needs: check_commit @@ -50,9 +61,6 @@ jobs: - name: check (default features) run: cargo check - - name: cargo-fmt - run: cargo fmt --all --check - - name: check (${{matrix.feature}}) run: cargo check --no-default-features --features ${{matrix.feature}} From 3b6762a2f8bf95733ef9839f4c58c154e4614979 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:21:37 +0100 Subject: [PATCH 06/10] ci: disable integration tests again this was never going to work without the server --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bc7f40c5..cd07487cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,14 +64,14 @@ jobs: - name: check (${{matrix.feature}}) run: cargo check --no-default-features --features ${{matrix.feature}} - - name: test (default features) - run: cargo test + # - name: test (default features) + # run: cargo test - name: test lib (${{matrix.feature}}) run: cargo test --lib --no-default-features --features ${{matrix.feature}} - - name: test tests (${{matrix.feature}}) - run: cargo test --tests --no-default-features --features ${{matrix.feature}} + # - name: test tests (${{matrix.feature}}) + # run: cargo test --tests --no-default-features --features ${{matrix.feature}} - name: test docs (${{matrix.feature}}) run: cargo test --doc --no-default-features --features ${{matrix.feature}} From 6e9ce26c85e214c6db1245029b187091ef127900 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:36:49 +0100 Subject: [PATCH 07/10] ci: run clippy only once --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd07487cb..afd9bbbbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,16 +28,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: cargo-fmt run: cargo fmt --all --check + - name: clippy + run: cargo clippy --all-features -- -D warnings + linux: name: linux needs: check_commit runs-on: ubuntu-latest strategy: + #fail-fast: true matrix: rust: - stable @@ -79,9 +84,6 @@ jobs: - name: clippy (default features) run: cargo clippy - - name: clippy (${{matrix.feature}}) - run: cargo clippy --no-default-features --features ${{matrix.feature}} -- -D warnings - windows: name: windows needs: check_commit From 683fcda6073d75bfd1203b9f87eecdaf097907f2 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:44:09 +0100 Subject: [PATCH 08/10] ci: only support latest 6 releases we were already at 1.70 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afd9bbbbd..d19d99dc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: rust: - stable - beta - - stable minus 8 releases + - stable minus 6 releases feature: - d - d,images @@ -93,7 +93,7 @@ jobs: rust: - stable - beta - - stable minus 8 releases + - stable minus 6 releases steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 @@ -121,7 +121,7 @@ jobs: rust: - stable - beta - - stable minus 8 releases + - stable minus 6 releases steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 From f504ca78a53bcb4a1899104b50005999e69969c1 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Wed, 22 Nov 2023 20:47:13 +0100 Subject: [PATCH 09/10] ci: disable clippy --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d19d99dc6..579527077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} rm convco - check_fmt: + check_fmt_clippy: name: Check Format needs: check_commit runs-on: ubuntu-latest @@ -34,8 +34,8 @@ jobs: - name: cargo-fmt run: cargo fmt --all --check - - name: clippy - run: cargo clippy --all-features -- -D warnings + #- name: clippy + # run: cargo clippy --all-features -- -D warnings linux: name: linux From 3c2faa5c5505dae1e5cf7bad311f51359a66f470 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Mon, 27 Nov 2023 00:25:17 +0100 Subject: [PATCH 10/10] ci: split out pr-check again --- .github/workflows/ci.yml | 39 +++++------------------------- .github/workflows/pull-request.yml | 36 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 579527077..d4a3d24cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,40 +6,13 @@ on: pull_request: jobs: - check_commit: - name: Check Commit Message - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - # A PR should not contain too many commits - fetch-depth: 10 - - name: Validate commit messages - run: | - git show-ref - curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco - chmod +x convco - ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} - rm convco - - check_fmt_clippy: - name: Check Format - needs: check_commit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - - name: cargo-fmt - run: cargo fmt --all --check - - #- name: clippy - # run: cargo clippy --all-features -- -D warnings + pr_check: + name: Pull Request Check + uses: ./.github/workflows/pull-request.yml linux: name: linux - needs: check_commit + needs: pr_check runs-on: ubuntu-latest strategy: #fail-fast: true @@ -86,7 +59,7 @@ jobs: windows: name: windows - needs: check_commit + needs: pr_check runs-on: windows-latest strategy: matrix: @@ -114,7 +87,7 @@ jobs: macos: name: macos - needs: check_commit + needs: pr_check runs-on: macos-latest strategy: matrix: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..b0efc7e66 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,36 @@ +name: Pull request +# This workflow is triggered on pushes to the repository. +on: [ pull_request, workflow_call, workflow_dispatch ] + +jobs: + check: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # A PR should not contain too many commits + fetch-depth: 10 + - name: Validate commit messages + run: | + git show-ref + curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco + chmod +x convco + ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} + rm convco + + check_fmt_clippy: + name: Check Format + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + + - name: cargo-fmt + run: cargo fmt --all --check + + #- name: clippy + # run: cargo clippy --all-features -- -D warnings +