github: Build examples as well as tests in quality workflow

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2023-02-16 08:02:03 +00:00 committed by Bo Chen
parent 879411e70f
commit 7ceb126184

View File

@ -51,7 +51,7 @@ jobs:
run: | run: |
set -e set -e
commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }}) commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }})
for commit in $commits; do git checkout $commit; cargo check --tests --all --target=${{ matrix.target }}; done for commit in $commits; do git checkout $commit; cargo check --tests --examples --all --target=${{ matrix.target }}; done
git checkout ${{ github.sha }} git checkout ${{ github.sha }}
- name: Formatting (rustfmt) - name: Formatting (rustfmt)
@ -62,28 +62,28 @@ jobs:
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --features "kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (default features) - name: Clippy (default features)
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --tests -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (default features + guest_debug) - name: Clippy (default features + guest_debug)
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --tests --features "guest_debug" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples --features "guest_debug" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (default features + tracing) - name: Clippy (default features + tracing)
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --tests --features "tracing" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples --features "tracing" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (mshv) - name: Clippy (mshv)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
@ -91,7 +91,7 @@ jobs:
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --features "mshv" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "mshv" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (mshv + kvm) - name: Clippy (mshv + kvm)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
@ -99,7 +99,7 @@ jobs:
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --features "mshv,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "mshv,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Clippy (kvm + tdx) - name: Clippy (kvm + tdx)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
@ -107,7 +107,7 @@ jobs:
with: with:
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
command: clippy command: clippy
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --features "tdx,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "tdx,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
- name: Check build did not modify any files - name: Check build did not modify any files
run: test -z "$(git status --porcelain)" run: test -z "$(git status --porcelain)"