Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates ci workflows #197

Merged
merged 10 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
283 changes: 65 additions & 218 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 15 additions & 10 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
- 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