summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRina Fujino <18257209+rina23q@users.noreply.github.com>2022-06-15 12:19:37 +0200
committerGitHub <noreply@github.com>2022-06-15 12:19:37 +0200
commit3d35d4915256b451dcc03678de55de3e3ac7e023 (patch)
tree6f800f45cf5e0130ce817382efa65b18d16cd45a
parentc42bd55cfd809903e5a46e3afc23aa80e25609f5 (diff)
Merge all pull request checks into one workflow (#1192)
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
-rw-r--r--.github/workflows/block-fixup-commits.yml13
-rw-r--r--.github/workflows/commit-workflow-optional.yml89
-rw-r--r--.github/workflows/doc-check.yml51
-rw-r--r--.github/workflows/pull-request-checks.yml (renamed from .github/workflows/commit-workflow.yml)164
4 files changed, 163 insertions, 154 deletions
diff --git a/.github/workflows/block-fixup-commits.yml b/.github/workflows/block-fixup-commits.yml
deleted file mode 100644
index 09aa5c0c..00000000
--- a/.github/workflows/block-fixup-commits.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-on: [pull_request]
-
-name: Block fixup commits
-
-jobs:
- block-fixup:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2.4.0
- - name: Block Fixup Commit Merge
- uses: 13rac1/block-fixup-merge-action@v2.0.0
-
diff --git a/.github/workflows/commit-workflow-optional.yml b/.github/workflows/commit-workflow-optional.yml
deleted file mode 100644
index 31815757..00000000
--- a/.github/workflows/commit-workflow-optional.yml
+++ /dev/null
@@ -1,89 +0,0 @@
-name: commit-workflow-optional
-
-on:
- workflow_dispatch:
- pull_request:
-
-env:
- CARGO_TERM_COLOR: always
-
-jobs:
- cargo-audit:
- name: Run cargo audit
- runs-on: Ubuntu-20.04
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Cargo audit
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: audit
-
- cargo-outdated:
- name: Run cargo outdated
- runs-on: Ubuntu-20.04
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Enable cache
- # https://github.com/marketplace/actions/rust-cache
- uses: Swatinem/rust-cache@v1
-
- - name: Cargo outdated --version
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: outdated
- args: --version
-
- - name: Cargo outdated
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: outdated
-
-### Disable cargo-tarpaulin as some tests failed only in this step
-# cargo-tarpaulin:
-# name: Run cargo tarpaulin
-# runs-on: Ubuntu-20.04
-#
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v2
-#
-# - name: Install rust v1.58.1
-# uses: actions-rs/toolchain@v1
-# with:
-# toolchain: 1.58.1
-# override: true
-#
-# - name: Enable cache
-# # https://github.com/marketplace/actions/rust-cache
-# uses: Swatinem/rust-cache@v1
-#
-# - name: install libssl
-# run: sudo apt install libssl-dev
-#
-# - name: Cargo install tarpaulin
-# uses: actions-rs/cargo@v1
-# # https://github.com/marketplace/actions/rust-cargo
-# with:
-# command: install
-# args: cargo-tarpaulin
-#
-# - name: Cargo tarpaulin
-# uses: actions-rs/cargo@v1
-# # https://github.com/marketplace/actions/rust-cargo
-# with:
-# command: tarpaulin
-# args: --skip-clean --avoid-cfg-tarpaulin -v --out Xml
-#
-# - name: Upload to codecov.io
-# uses: codecov/codecov-action@v1
-# with:
-# token: ${{secrets.CODECOV_TOKEN}}
diff --git a/.github/workflows/doc-check.yml b/.github/workflows/doc-check.yml
deleted file mode 100644
index c679eb12..00000000
--- a/.github/workflows/doc-check.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: Documentation check
-
-on:
- workflow_dispatch:
- pull_request:
- branches: [ main, 'release-*' ]
- paths:
- # Any files in the /docs directory at the root of the repository.
- - 'docs/**'
-
-jobs:
- mdbook-build-check:
- name: Run mdbook build
- runs-on: ubuntu-20.04
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Setup mdBook
- uses: peaceiris/actions-mdbook@v1
- # https://github.com/marketplace/actions/mdbook-action
- with:
- mdbook-version: "0.4.18"
- # mdbook-version: 'latest'
-
- - name: Install mdbook-toc
- uses: actions-rs/install@v0.1
- # https://github.com/marketplace/actions/rust-cargo-install
- with:
- crate: mdbook-toc
- version: latest
-
- - name: Install mdbook-mermaid
- uses: actions-rs/install@v0.1
- # https://github.com/marketplace/actions/rust-cargo-install
- with:
- crate: mdbook-mermaid
- version: latest
-
- - name: Install mdbook-linkcheck
- uses: actions-rs/install@v0.1
- # https://github.com/marketplace/actions/rust-cargo-install
- with:
- crate: mdbook-linkcheck
- version: latest
-
- - name: Run mdbook build
- run: |
- ls -l
- cd docs
- mdbook build
diff --git a/.github/workflows/commit-workflow.yml b/.github/workflows/pull-request-checks.yml
index 4cf28d15..e9b6f544 100644
--- a/.github/workflows/commit-workflow.yml
+++ b/.github/workflows/pull-request-checks.yml
@@ -1,4 +1,4 @@
-name: commit-workflow
+name: Pull Request Checks
on:
workflow_dispatch:
@@ -8,9 +8,86 @@ env:
CARGO_TERM_COLOR: always
jobs:
+ block-fixup:
+ name: Block fixup commits
+ runs-on: Ubuntu-20.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Block Fixup Commit Merge
+ # https://github.com/13rac1/block-fixup-merge-action
+ uses: 13rac1/block-fixup-merge-action@v2.0.0
+
+ # JOB to run change detection
+ changes:
+ name: Filter changes
+ runs-on: Ubuntu-20.04
+ # Set job outputs to values from filter step
+ outputs:
+ docs: ${{ steps.filter.outputs.docs }}
+ rust: ${{ steps.filter.outputs.rust }}
+ steps:
+ # For pull requests it's not necessary to checkout the code
+ - uses: dorny/paths-filter@v2
+ # https://github.com/dorny/paths-filter
+ id: filter
+ with:
+ filters: |
+ docs:
+ - 'docs/**'
+ rust:
+ - 'crates/**'
+ - 'plugins/**'
+
+ mdbook-build-check:
+ name: Run mdbook build
+ runs-on: ubuntu-20.04
+ needs: changes
+ if: ${{ needs.changes.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Setup mdBook
+ uses: peaceiris/actions-mdbook@v1
+ # https://github.com/marketplace/actions/mdbook-action
+ with:
+ mdbook-version: "0.4.18"
+ #mdbook-version: 'latest'
+
+ - name: Install mdbook-toc
+ uses: actions-rs/install@v0.1
+ # https://github.com/marketplace/actions/rust-cargo-install
+ with:
+ crate: mdbook-toc
+ version: latest
+
+ - name: Install mdbook-mermaid
+ uses: actions-rs/install@v0.1
+ # https://github.com/marketplace/actions/rust-cargo-install
+ with:
+ crate: mdbook-mermaid
+ version: latest
+
+ - name: Install mdbook-linkcheck
+ uses: actions-rs/install@v0.1
+ # https://github.com/marketplace/actions/rust-cargo-install
+ with:
+ crate: mdbook-linkcheck
+ version: latest
+
+ - name: Run mdbook build
+ run: |
+ ls -l
+ cd docs
+ mdbook build
+
cargo-fmt:
name: Run cargo fmt
runs-on: Ubuntu-20.04
+ needs: changes
+ if: ${{ needs.changes.outputs.rust == 'true' }}
steps:
- name: Checkout
@@ -33,6 +110,8 @@ jobs:
cargo-clippy:
name: Run cargo clippy
runs-on: Ubuntu-20.04
+ needs: changes
+ if: ${{ needs.changes.outputs.rust == 'true' }}
steps:
- name: Checkout
@@ -64,6 +143,49 @@ jobs:
toolchain: 1.58.1
command: clippy
+ cargo-audit:
+ name: Run cargo audit
+ runs-on: Ubuntu-20.04
+ needs: changes
+ if: ${{ needs.changes.outputs.rust == 'true' }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Cargo audit
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: audit
+
+ cargo-outdated:
+ name: Run cargo outdated
+ runs-on: Ubuntu-20.04
+ needs: changes
+ if: ${{ needs.changes.outputs.rust == 'true' }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Enable cache
+ # https://github.com/marketplace/actions/rust-cache
+ uses: Swatinem/rust-cache@v1
+
+ - name: Cargo outdated --version
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: outdated
+ args: --version
+
+ - name: Cargo outdated
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: outdated
+
cargo-test:
name: Run cargo test
runs-on: Ubuntu-20.04
@@ -192,3 +314,43 @@ jobs:
command: test
args: --release --no-run --target=armv7-unknown-linux-gnueabihf
+### Disable cargo-tarpaulin as some tests failed only in this step
+# cargo-tarpaulin:
+# name: Run cargo tarpaulin
+# runs-on: Ubuntu-20.04
+#
+# steps:
+# - name: Checkout
+# uses: actions/checkout@v2
+#
+# - name: Install rust v1.58.1
+# uses: actions-rs/toolchain@v1
+# with:
+# toolchain: 1.58.1
+# override: true
+#
+# - name: Enable cache
+# # https://github.com/marketplace/actions/rust-cache
+# uses: Swatinem/rust-cache@v1
+#
+# - name: install libssl
+# run: sudo apt install libssl-dev
+#
+# - name: Cargo install tarpaulin
+# uses: actions-rs/cargo@v1
+# # https://github.com/marketplace/actions/rust-cargo
+# with:
+# command: install
+# args: cargo-tarpaulin
+#
+# - name: Cargo tarpaulin
+# uses: actions-rs/cargo@v1
+# # https://github.com/marketplace/actions/rust-cargo
+# with:
+# command: tarpaulin
+# args: --skip-clean --avoid-cfg-tarpaulin -v --out Xml
+#
+# - name: Upload to codecov.io
+# uses: codecov/codecov-action@v1
+# with:
+# token: ${{secrets.CODECOV_TOKEN}}