diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba4555cc..d4a3d24c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,261 +6,108 @@ on: pull_request: jobs: - linux_dbus: - name: linux (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 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 + pr_check: + name: Pull Request Check + uses: ./.github/workflows/pull-request.yml - - 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) + linux: + name: linux + needs: pr_check runs-on: ubuntu-latest strategy: + #fail-fast: true matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 6 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: check (default features) + run: cargo check - - name: test_features_images - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features d,images + - name: check (${{matrix.feature}}) + run: cargo check --no-default-features --features ${{matrix.feature}} - - 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: test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --no-default-features --features z - - - name: doc_test (zbus) - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc --no-default-features --features z - - 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 + - name: clippy (default features) + run: cargo clippy - linux_zbus_and_dbus: - name: linux (zbus and dbus) - runs-on: ubuntu-latest + windows: + name: windows + needs: pr_check + runs-on: windows-latest strategy: matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 6 releases 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 - - run: sudo apt-get install -y libdbus-1-dev + components: clippy, rustfmt - - name: check - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features z,d + - 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,d + - name: test (default features) + run: cargo test --no-run - - 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 -- -D warnings - windows: - name: windows - runs-on: windows-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 - - 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 - macos: name: macos + needs: pr_check runs-on: macos-latest strategy: matrix: rust: - stable - - 1.70.0 + - beta + - stable minus 6 releases 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 - - 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 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3fd8bac2..b0efc7e6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,13 +1,13 @@ name: Pull request # This workflow is triggered on pushes to the repository. -on: [ pull_request ] +on: [ pull_request, workflow_call, workflow_dispatch ] jobs: check: 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 @@ -19,13 +19,18 @@ jobs: ./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} rm convco - fmt: - name: Rustfmt + check_fmt_clippy: + name: Check Format + needs: check 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 + - 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 +