From cc7a5aca6c6855df73f0fb5c7c5d1559dffc2478 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 6 Oct 2020 10:52:06 +0200 Subject: [PATCH] ci: Validate each commit can be built It's important to ensure Cloud-Hypervisor's Git tree is bisectable, and that's why this commit extends the existing build.yaml Github action. This will validate that each commit from an incoming pull request can be built. Fixes #1808 Signed-off-by: Sebastien Boeuf --- .github/workflows/build.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9589a1098..3dc70b126 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,6 +18,9 @@ jobs: steps: - name: Code checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install Rust toolchain (${{ matrix.rust }}) uses: actions-rs/toolchain@v1 with: @@ -26,7 +29,9 @@ jobs: override: true - name: Debug Build (default features) - run: cargo build --all --target=${{ matrix.target }} + run: | + git rev-list origin/master..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo build --all --target=${{ matrix.target }}' + git checkout $GITHUB_SHA - name: Build (pci,acpi,kvm) run: cargo rustc --bin cloud-hypervisor --no-default-features --features "pci,acpi,kvm" -- -D warnings