Skip to content

Commit bfda1cd

Browse files
committed
ci: Also check whether all commits build
1 parent a8104e9 commit bfda1cd

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/ci.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ jobs:
4040
- name: Run cargo fmt
4141
run: cargo fmt --all -- --check
4242

43-
clippy:
44-
name: Clippy
43+
code-analysis:
44+
name: Code Analysis
4545
runs-on: ubuntu-latest
4646
container:
4747
image: bilelmoussaoui/flatpak-github-actions:gnome-44
4848
options: --privileged
49+
needs: [check-commit-style, typos, rustfmt]
4950
steps:
5051
- uses: actions/checkout@v3
52+
with:
53+
fetch-depth: 0
5154

5255
- name: Cache flatpak
5356
id: cache-flatpak
@@ -95,6 +98,17 @@ jobs:
9598
key: ${{ runner.os }}-target-${{ steps.rustc-version.outputs.RUSTC_VERSION }}-${{ hashFiles('Cargo.lock') }}
9699
restore-keys: ${{ runner.os }}-target-${{ steps.rustc-version.outputs.RUSTC_VERSION }}
97100

101+
- name: Test if all commits build
102+
run: |
103+
for commit in $(git rev-list ${{ github.base_ref }}..${{ github.head_ref }}); do
104+
git checkout $commit
105+
106+
flatpak-builder \
107+
--run \
108+
flatpak_app build-aux/com.github.marhkb.Pods.Devel.json \
109+
cargo build
110+
done
111+
98112
- name: Run clippy
99113
run: |
100114
flatpak-builder \
@@ -113,7 +127,7 @@ jobs:
113127
arch: [x86_64]
114128
# Don't fail the whole workflow if one architecture fails
115129
fail-fast: false
116-
needs: [check-commit-style, typos, rustfmt, clippy]
130+
needs: [code-analysis]
117131
steps:
118132
- uses: actions/checkout@v3
119133
# Docker is required by the docker/setup-qemu-action which enables emulation

0 commit comments

Comments
 (0)