Skip to content

Commit 88b076e

Browse files
committed
ci: run make sparse as part of the GitHub workflow
Occasionally we receive reviews after patches were integrated, where `sparse` (https://sparse.docs.kernel.org/en/latest/ has more information on that project) identified problems such as file-local variables or functions being declared as global. By running `sparse` as part of our Continuous Integration, we can catch such things much earlier. Even better: developers who activated GitHub Actions on their forks can catch such issues before even sending their patches to the Git mailing list. This addresses gitgitgadget#345 Note: Not even Ubuntu 20.04 ships with a new enough version of `sparse` to accommodate Git's needs. Therefore, we download and install the custom-built `sparse` package from the Azure Pipeline we specifically created to address this issue. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 75ae10b commit 88b076e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,23 @@ jobs:
350350
- uses: actions/checkout@v1
351351
- run: ci/install-dependencies.sh
352352
- run: ci/run-static-analysis.sh
353+
sparse:
354+
runs-on: ubuntu-20.04
355+
steps:
356+
- name: Download a current `sparse` package
357+
# Ubuntu's `sparse` version is too old for us
358+
uses: git-for-windows/get-azure-pipelines-artifact@v0
359+
with:
360+
repository: git/git
361+
definitionId: 10
362+
artifact: sparse-20.04
363+
- name: Install the current `sparse` package
364+
run: sudo dpkg -i sparse-20.04/sparse_*.deb
365+
- name: Install other dependencies
366+
run: |
367+
sudo apt-get install -q -y libssl-dev libcurl4-openssl-dev libexpat-dev gettext zlib1g-dev
368+
- uses: actions/checkout@v2
369+
- run: make sparse
353370
documentation:
354371
needs: ci-config
355372
if: needs.ci-config.outputs.enabled == 'yes'

0 commit comments

Comments
 (0)