summaryrefslogtreecommitdiffstats
path: root/.github/workflows (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-05-24Merge branch 'fixes/2.45.1/2.43' into fixes/2.45.1/2.44Junio C Hamano1-2/+1
* fixes/2.45.1/2.43: Revert "fsck: warn about symlink pointing inside a gitdir" Revert "Add a helper function to compare file contents" clone: drop the protections where hooks aren't run tests: verify that `clone -c core.hooksPath=/dev/null` works again Revert "core.hooksPath: add some protection while cloning" init: use the correct path of the templates directory again hook: plug a new memory leak ci: stop installing "gcc-13" for osx-gcc ci: avoid bare "gcc" for osx-gcc job ci: drop mention of BREW_INSTALL_PACKAGES variable send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack
2024-05-24Merge branch 'fixes/2.45.1/2.41' into fixes/2.45.1/2.42Junio C Hamano1-2/+1
* fixes/2.45.1/2.41: Revert "fsck: warn about symlink pointing inside a gitdir" Revert "Add a helper function to compare file contents" clone: drop the protections where hooks aren't run tests: verify that `clone -c core.hooksPath=/dev/null` works again Revert "core.hooksPath: add some protection while cloning" init: use the correct path of the templates directory again hook: plug a new memory leak ci: stop installing "gcc-13" for osx-gcc ci: avoid bare "gcc" for osx-gcc job ci: drop mention of BREW_INSTALL_PACKAGES variable send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack
2024-05-24Merge branch 'jc/fix-2.45.1-and-friends-for-2.39' into fixes/2.45.1/2.40Junio C Hamano1-2/+1
Revert overly aggressive "layered defence" that went into 2.45.1 and friends, which broke "git-lfs", "git-annex", and other use cases, so that we can rebuild necessary counterparts in the open. * jc/fix-2.45.1-and-friends-for-2.39: Revert "fsck: warn about symlink pointing inside a gitdir" Revert "Add a helper function to compare file contents" clone: drop the protections where hooks aren't run tests: verify that `clone -c core.hooksPath=/dev/null` works again Revert "core.hooksPath: add some protection while cloning" init: use the correct path of the templates directory again hook: plug a new memory leak ci: stop installing "gcc-13" for osx-gcc ci: avoid bare "gcc" for osx-gcc job ci: drop mention of BREW_INSTALL_PACKAGES variable send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack
2024-05-21ci: stop installing "gcc-13" for osx-gccJeff King1-1/+0
Our osx-gcc job explicitly asks to install gcc-13. But since the GitHub runner image already comes with gcc-13 installed, this is mostly doing nothing (or in some cases it may install an incremental update over the runner image). But worse, it recently started causing errors like: ==> Fetching gcc@13 ==> Downloading https://ghcr.io/v2/homebrew/core/gcc/13/blobs/sha256:fb2403d97e2ce67eb441b54557cfb61980830f3ba26d4c5a1fe5ecd0c9730d1a ==> Pouring gcc@13--13.2.0.ventura.bottle.tar.gz Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/c++-13 Target /usr/local/bin/c++-13 is a symlink belonging to gcc. You can unlink it: brew unlink gcc which cause the whole CI job to bail. I didn't track down the root cause, but I suspect it may be related to homebrew recently switching the "gcc" default to gcc-14. And it may even be fixed when a new runner image is released. But if we don't need to run brew at all, it's one less thing for us to worry about. [jc: cherry-picked from v2.45.0-3-g7df2405b38] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-05-21ci: avoid bare "gcc" for osx-gcc jobJeff King1-1/+1
On macOS, a bare "gcc" (without a version) will invoke a wrapper for clang, not actual gcc. Even when gcc is installed via homebrew, that only provides version-specific links in /usr/local/bin (like "gcc-13"), and never a version-agnostic "gcc" wrapper. As far as I can tell, this has been the case for a long time, and this osx-gcc job has largely been doing nothing. We can point it at "gcc-13", which will pick up the homebrew-installed version. The fix here is specific to the github workflow file, as the gitlab one does not have a matching job. It's a little unfortunate that we cannot just ask for the latest version of gcc which homebrew provides, but as far as I can tell there is no easy alias (you'd have to find the highest number gcc-* in /usr/local/bin yourself). [jc: cherry-picked from v2.45.0-2-g11c7001e3d] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-19Sync with 2.41.1Johannes Schindelin2-23/+23
* maint-2.41: (38 commits) Git 2.41.1 Git 2.40.2 Git 2.39.4 fsck: warn about symlink pointing inside a gitdir core.hooksPath: add some protection while cloning init.templateDir: consider this config setting protected clone: prevent hooks from running during a clone Add a helper function to compare file contents init: refactor the template directory discovery into its own function find_hook(): refactor the `STRIP_EXTENSION` logic clone: when symbolic links collide with directories, keep the latter entry: report more colliding paths t5510: verify that D/F confusion cannot lead to an RCE submodule: require the submodule path to contain directories only clone_submodule: avoid using `access()` on directories submodules: submodule paths must not contain symlinks clone: prevent clashing git dirs when cloning submodule in parallel t7423: add tests for symlinked submodule directories has_dir_name(): do not get confused by characters < '/' docs: document security issues around untrusted .git dirs ...
2024-04-19Sync with 2.39.4Johannes Schindelin2-23/+23
* maint-2.39: (38 commits) Git 2.39.4 fsck: warn about symlink pointing inside a gitdir core.hooksPath: add some protection while cloning init.templateDir: consider this config setting protected clone: prevent hooks from running during a clone Add a helper function to compare file contents init: refactor the template directory discovery into its own function find_hook(): refactor the `STRIP_EXTENSION` logic clone: when symbolic links collide with directories, keep the latter entry: report more colliding paths t5510: verify that D/F confusion cannot lead to an RCE submodule: require the submodule path to contain directories only clone_submodule: avoid using `access()` on directories submodules: submodule paths must not contain symlinks clone: prevent clashing git dirs when cloning submodule in parallel t7423: add tests for symlinked submodule directories has_dir_name(): do not get confused by characters < '/' docs: document security issues around untrusted .git dirs upload-pack: disable lazy-fetching by default fetch/clone: detect dubious ownership of local repositories ...
2024-04-17ci(linux32): add a note about Actions that must not be updatedJohannes Schindelin1-2/+2
The Docker container used by the `linux32` job comes without Node.js, and therefore the `actions/checkout` and `actions/upload-artifact` Actions cannot be upgraded to the latest versions (because they use Node.js). One time too many, I accidentally tried to update them, where `actions/checkout` at least fails immediately, but the `actions/upload-artifact` step is only used when any test fails, and therefore the CI run usually passes even though that Action was updated to a version that is incompatible with the Docker container in which this job runs. So let's add a big fat warning, mainly for my own benefit, to avoid running into the very same issue over and over again. Backported-from: 20e0ff8835 (ci(linux32): add a note about Actions that must not be updated, 2024-02-11) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-04-17ci: bump remaining outdated Actions versionsJohannes Schindelin1-8/+8
After activating automatic Dependabot updates in the git-for-windows/git repository, Dependabot noticed a couple of yet-unaddressed updates. They avoid "Node.js 16 Actions" deprecation messages by bumping the following Actions' versions: - actions/upload-artifact from 3 to 4 - actions/download-artifact from 3 to 4 - actions/cache from 3 to 4 Backported-from: 820a340085 (ci: bump remaining outdated Actions versions, 2024-02-11) Helped-by: Matthias Aßhauer <mha1993@live.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-04-17GitHub Actions: update to github-script@v7Junio C Hamano1-1/+1
We seem to be getting "Node.js 16 actions are deprecated." warnings for jobs that use github-script@v6. Update to github-script@v7, which is said to use Node.js 20. Backported-from: c4ddbe043e (GitHub Actions: update to github-script@v7, 2024-02-02) Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-04-17GitHub Actions: update to checkout@v4Junio C Hamano2-9/+9
We seem to be getting "Node.js 16 actions are deprecated." warnings for jobs that use checkout@v3. Except for the i686 containers job that is kept at checkout@v1 [*], update to checkout@v4, which is said to use Node.js 20. [*] 6cf4d908 (ci(main): upgrade actions/checkout to v3, 2022-12-05) refers to https://github.com/actions/runner/issues/2115 and explains why container jobs are kept at checkout@v1. We may want to check the current status of the issue and move it to the same version as other jobs, but that is outside the scope of this step. Backported-from: e94dec0c1d (GitHub Actions: update to checkout@v4, 2024-02-02) Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-04-16ci: upgrade to using macos-13Johannes Schindelin1-3/+3
In April, GitHub announced that the `macos-13` pool is available: https://github.blog/changelog/2023-04-24-github-actions-macos-13-is-now-available/. It is only a matter of time until the `macos-12` pool is going away, therefore we should switch now, without pressure of a looming deadline. Since the `macos-13` runners no longer include Python2, we also drop specifically testing with Python2 and switch uniformly to Python3, see https://github.com/actions/runner-images/blob/HEAD/images/macos/macos-13-Readme.md for details about the software available on the `macos-13` pool's runners. Also, on macOS 13, Homebrew seems to install a `gcc@9` package that no longer comes with a regular `unistd.h` (there seems only to be a `ssp/unistd.h`), and hence builds would fail with: In file included from base85.c:1: git-compat-util.h:223:10: fatal error: unistd.h: No such file or directory 223 | #include <unistd.h> | ^~~~~~~~~~ compilation terminated. The reason why we install GCC v9.x explicitly is historical, and back in the days it was because it was the _newest_ version available via Homebrew: 176441bfb58 (ci: build Git with GCC 9 in the 'osx-gcc' build job, 2019-11-27). To reinstate the spirit of that commit _and_ to fix that build failure, let's switch to the now-newest GCC version: v13.x. Backported-from: 682a868f67 (ci: upgrade to using macos-13, 2023-11-03) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-02-16l10n: ci: disable cache for setup-go to suppress warningsJiang Xin1-0/+1
After we upgraded actions/setup-go to v5, the following warning message was reported every time we ran the CI. Restore cache failed: Dependencies file is not found ... Disable cache to suppress warning messages as described in the solution below. https://github.com/actions/setup-go/issues/427 Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2024-02-16l10n: ci: remove unused param for add-pr-comment@v2Jiang Xin1-1/+0
When we upgraded GitHub Actions "mshick/add-pr-comment" to v2, the following warning message was reported every time we ran the CI. Unexpected input(s) 'repo-token-user-login', valid inputs ... Removed the obsolete parameter "repo-token-user-login" to suppress warning messages. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2024-02-15Merge branch 'master' of github.com:git/gitJiang Xin3-24/+24
* 'master' of github.com:git/git: (51 commits) Hopefully the last batch of fixes before 2.44 final Git 2.43.2 A few more fixes before -rc1 write-or-die: fix the polarity of GIT_FLUSH environment variable A few more topics before -rc1 completion: add and use __git_compute_second_level_config_vars_for_section completion: add and use __git_compute_first_level_config_vars_for_section completion: complete 'submodule.*' config variables completion: add space after config variable names also in Bash 3 receive-pack: use find_commit_header() in check_nonce() ci(linux32): add a note about Actions that must not be updated ci: bump remaining outdated Actions versions unit-tests: do show relative file paths on non-Windows, too receive-pack: use find_commit_header() in check_cert_push_options() prune: mark rebase autostash and orig-head as reachable sequencer: unset GIT_CHERRY_PICK_HELP for 'exec' commands ref-filter.c: sort formatted dates by byte value ssh signing: signal an error with a negative return value bisect: document command line arguments for "bisect start" bisect: document "terms" subcommand more fully ...
2024-02-12ci(linux32): add a note about Actions that must not be updatedJohannes Schindelin1-2/+2
The Docker container used by the `linux32` job comes without Node.js, and therefore the `actions/checkout` and `actions/upload-artifact` Actions cannot be upgraded to the latest versions (because they use Node.js). One time too many, I accidentally tried to update them, where `actions/checkout` at least fails immediately, but the `actions/upload-artifact` step is only used when any test fails, and therefore the CI run usually passes even though that Action was updated to a version that is incompatible with the Docker container in which this job runs. So let's add a big fat warning, mainly for my own benefit, to avoid running into the very same issue over and over again. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12ci: bump remaining outdated Actions versionsJohannes Schindelin2-10/+10
After activating automatic Dependabot updates in the git-for-windows/git repository, Dependabot noticed a couple of yet-unaddressed updates. They avoid "Node.js 16 Actions" deprecation messages by bumping the following Actions' versions: - actions/upload-artifact from 3 to 4 - actions/download-artifact from 3 to 4 - actions/cache from 3 to 4 Helped-by: Matthias Aßhauer <mha1993@live.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-11l10n: bump Actions versions in l10n.ymlJohannes Schindelin1-2/+2
This avoids the "Node.js 16 Actions are deprecated" warnings. Original-commits-by: dependabot[bot] <support@github.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-02-02Merge branch 'jc/maint-github-actions-update' into jc/github-actions-updateJunio C Hamano3-12/+12
This contains an evil merge to tell the fuzz-smoke-test job to also use checkout@v4; the job has been added since the master track diverged from the maintenance track. * jc/maint-github-actions-update: GitHub Actions: update to github-script@v7 GitHub Actions: update to checkout@v4
2024-02-02GitHub Actions: update to github-script@v7Junio C Hamano1-1/+1
We seem to be getting "Node.js 16 actions are deprecated." warnings for jobs that use github-script@v6. Update to github-script@v7, which is said to use Node.js 20. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-02GitHub Actions: update to checkout@v4Junio C Hamano3-10/+10
We seem to be getting "Node.js 16 actions are deprecated." warnings for jobs that use checkout@v3. Except for the i686 containers job that is kept at checkout@v1 [*], update to checkout@v4, which is said to use Node.js 20. [*] 6cf4d908 (ci(main): upgrade actions/checkout to v3, 2022-12-05) refers to https://github.com/actions/runner/issues/2115 and explains why container jobs are kept at checkout@v1. We may want to check the current status of the issue and move it to the same version as other jobs, but that is outside the scope of this step. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-01-19ci: build and run minimal fuzzers in GitHub CIJosh Steadmon1-0/+11
To prevent bitrot, we would like to regularly exercise the fuzz tests in order to make sure they still link & run properly. We already compile the fuzz test objects as part of the default `make` target, but we do not link the executables due to the fuzz tests needing specific compilers and compiler features. This has lead to frequent build breakages for the fuzz tests. To remedy this, we can add a CI step to actually link the fuzz executables, and run them (with finite input rather than the default infinite random input mode) to verify that they execute properly. Since the main use of the fuzz tests is via OSS-Fuzz [1], and OSS-Fuzz only runs tests on Linux [2], we only set up a CI test for the fuzzers on Linux. [1] https://github.com/google/oss-fuzz [2] https://google.github.io/oss-fuzz/further-reading/fuzzer-environment/ Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-11-03ci: upgrade to using macos-13Johannes Schindelin1-3/+3
In April, GitHub announced that the `macos-13` pool is available: https://github.blog/changelog/2023-04-24-github-actions-macos-13-is-now-available/. It is only a matter of time until the `macos-12` pool is going away, therefore we should switch now, without pressure of a looming deadline. Since the `macos-13` runners no longer include Python2, we also drop specifically testing with Python2 and switch uniformly to Python3, see https://github.com/actions/runner-images/blob/HEAD/images/macos/macos-13-Readme.md for details about the software available on the `macos-13` pool's runners. Also, on macOS 13, Homebrew seems to install a `gcc@9` package that no longer comes with a regular `unistd.h` (there seems only to be a `ssp/unistd.h`), and hence builds would fail with: In file included from base85.c:1: git-compat-util.h:223:10: fatal error: unistd.h: No such file or directory 223 | #include <unistd.h> | ^~~~~~~~~~ compilation terminated. The reason why we install GCC v9.x explicitly is historical, and back in the days it was because it was the _newest_ version available via Homebrew: 176441bfb58 (ci: build Git with GCC 9 in the 'osx-gcc' build job, 2019-11-27). To reinstate the spirit of that commit _and_ to fix that build failure, let's switch to the now-newest GCC version: v13.x. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-11-02Merge branch 'jk/ci-retire-allow-ref' into maint-2.42Junio C Hamano1-3/+7
CI update. * jk/ci-retire-allow-ref: ci: deprecate ci/config/allow-ref script ci: allow branch selection through "vars"
2023-11-02Merge branch 'jc/ci-skip-same-commit' into maint-2.42Junio C Hamano1-0/+13
Tweak GitHub Actions CI so that pushing the same commit to multiple branch tips at the same time will not waste building and testing the same thing twice. * jc/ci-skip-same-commit: ci: avoid building from the same commit in parallel
2023-10-05coverity: detect and report when the token or project is incorrectJohannes Schindelin1-1/+12
When trying to obtain the MD5 of the Coverity Scan Tool (in order to decide whether a cached version can be used or a new version has to be downloaded), it is possible to get a 401 (Authorization required) due to either an incorrect token, or even more likely due to an incorrect Coverity project name. Seeing an authorization failure that is caused by an incorrect project name was somewhat surprising to me when developing the Coverity workflow, as I found such a failure suggestive of an incorrect token instead. So let's provide a helpful error message about that specifically when encountering authentication issues. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-25coverity: allow running on macOSJohannes Schindelin1-2/+20
For completeness' sake, let's add support for submitting macOS builds to Coverity Scan. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-25coverity: support building on WindowsJohannes Schindelin1-6/+51
By adding the repository variable `ENABLE_COVERITY_SCAN_ON_OS` with a value, say, `["windows-latest"]`, this GitHub workflow now runs on Windows, allowing to analyze Windows-specific issues. This allows, say, the Git for Windows fork to submit Windows builds to Coverity Scan instead of Linux builds. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-25coverity: allow overriding the Coverity projectJohannes Schindelin1-1/+4
By default, the builds are submitted to the `git` project at https://scan.coverity.com/projects/git. The Git for Windows project would like to use this workflow, too, though, and needs the builds to be submitted to the `git-for-windows` Coverity project. To that end, allow configuring the Coverity project name via the repository variable, you guessed it, `COVERITY_PROJECT`. The default if that variable is not configured or has an empty value is still `git`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-25coverity: cache the Coverity Build ToolJohannes Schindelin1-0/+28
It would add a 1GB+ download for every run, better cache it. This is inspired by the GitHub Action `vapier/coverity-scan-action`, however, it uses the finer-grained `restore`/`save` method to be able to cache the Coverity Build Tool even if an unrelated step in the GitHub workflow fails later on. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-25ci: add a GitHub workflow to submit Coverity scansJohannes Schindelin1-0/+58
Coverity is a static analysis tool that detects and generates reports on various security and code quality issues. It is particularly useful when diagnosing memory safety issues which may be used as part of exploiting a security vulnerability. Coverity's website provides a service that accepts "builds" (which contains the object files generated during a standard build as well as a database generated by Coverity's scan tool). Let's add a GitHub workflow to automate all of this. To avoid running it without appropriate Coverity configuration (e.g. the token required to use Coverity's services), the job only runs when the repository variable "ENABLE_COVERITY_SCAN_FOR_BRANCHES" has been configured accordingly (see https://docs.github.com/en/actions/learn-github-actions/variables for details how to configure repository variables): It is expected to be a valid JSON array of branch strings, e.g. `["main", "next"]`. In addition, this workflow requires two repository secrets: - COVERITY_SCAN_EMAIL: the email to send the report to, and - COVERITY_SCAN_TOKEN: the Coverity token (look in the Project Settings tab of your Coverity project). Note: The initial version of this patch used `vapier/coverity-scan-action` to benefit from that Action's caching of the Coverity tool, which is rather large. Sadly, that Action only supports Linux, and we want to have the option of building on Windows, too. Besides, in the meantime Coverity requires `cov-configure` to be runantime, and that Action was not adjusted accordingly, i.e. it seems not to be maintained actively. Therefore it would seem prudent to implement the steps manually instead of using that Action. Initial-patch-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-30ci: deprecate ci/config/allow-ref scriptJeff King1-3/+6
Now that we have the CI_BRANCHES mechanism, there is no need for anybody to use the ci/config/allow-ref mechanism. In the long run, we can hopefully remove it and the whole "config" job, as it consumes CPU and adds to the end-to-end latency of the whole workflow. But we don't want to do that immediately, as people need time to migrate until the CI_BRANCHES change has made it into the workflow file of every branch. So let's issue a warning, which will appear in the "annotations" section below the workflow result in GitHub's web interface. And let's remove the sample allow-refs script, as we don't want to encourage anybody to use it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-30ci: allow branch selection through "vars"Jeff King1-0/+1
When we added config to skip CI for certain branches in e76eec3554 (ci: allow per-branch config for GitHub Actions, 2020-05-07), there wasn't any way to avoid spinning up a VM just to check the config. From the developer's perspective this isn't too bad, as the "skipped" branches complete successfully after running the config job (the workflow result is "success" instead of "skipped", but that is a minor lie). But we are still wasting time and GitHub's CPU to spin up a VM just to check the result of a short shell script. At the time there wasn't any way to avoid this. But they've since introduced repo-level variables that should let us do the same thing: https://github.blog/2023-01-10-introducing-required-workflows-and-configuration-variables-to-github-actions/#configuration-variables This is more efficient, and as a bonus is probably less confusing to configure (the existing system requires sticking your config on a magic ref). See the included docs for how to configure it. The code itself is pretty simple: it checks the variable and skips the config job if appropriate (and everything else depends on the config job already). There are two slight inaccuracies here: - we don't insist on branches, so this likewise applies to tag names or other refs. I think in practice this is OK, and keeping the code (and docs) short is more important than trying to be more exact. We are targeting developers of git.git and their limited workflows. - the match is done as a substring (so if you want to run CI for "foobar", then branch "foo" will accidentally match). Again, this should be OK in practice, as anybody who uses this is likely to only specify a handful of well-known names. If we want to be more exact, we can have the code check for adjoining spaces. Or even move to a more general CI_CONFIG variable formatted as JSON. I went with this scheme for the sake of simplicity. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-25ci: avoid building from the same commit in parallelJohannes Schindelin1-0/+13
At times, we may need to push the same commit to multiple branches in the same push. Rewinding 'next' to rebuild on top of 'master' soon after a release is such an occasion. Making sure 'main' stays in sync with 'master' to help those who expect that primary branch of the project is named either of these is another. We already use the branch name as a "concurrency group" key, but that does not address the situation illustrated above. Let's introduce another `concurrency` attribute, using the commit hash as the concurrency group key, on the workflow run level, to address this. This will hold any workflow run in the queued state when there is already a workflow run targeting the same commit, until that latter run completed. The `skip-if-redundant` check of the second run will then have a chance to see whether the first run succeeded. The only caveat with this strategy is that only one workflow run will be kept in the queued state by the `concurrency` feature: if another run targeting the same commit is triggered, the previously-queued run will be canceled. Considering the benefit, this seems the smaller price to pay than to overload Git's build agent pool with undesired workflow runs. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-03ci: drop linux-clang jobJeff King1-3/+0
Since the linux-asan-ubsan job runs using clang under Linux, there is not much point in running a separate clang job. Any errors that a normal clang compile-and-test cycle would find are likely to be a subset of what the sanitizer job will find. Since this job takes ~14 minutes to run in CI, this shaves off some of our CPU load (though it does not affect end-to-end runtime, since it's typically run in parallel and is not the longest job). Technically this provides us with slightly less signal for a given run, since you won't immediately know if a failure in the sanitizer job is from using clang or from the sanitizers themselves. But it's generally obvious from the logs, and anyway your next step would be to fix the probvlem and re-run CI, since we expect all of these jobs to pass normally. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-03ci: run ASan/UBSan in a single jobJeff King1-4/+1
When we started running sanitizers in CI via 1c0962c0c4 (ci: add address and undefined sanitizer tasks, 2022-10-20), we ran them as two separate CI jobs, since as that commit notes, the combination "seems to take forever". And indeed, it does with gcc. However, since the previous commit switched to using clang, the situation is different, and we can save some CPU by using a single job for both. Comparing before/after CI runs, this saved about 14 minutes (the single combined job took 54m, versus 44m plus 24m for ASan and UBSan jobs, respectively). That's wall-clock and not CPU, but since our jobs are mostly CPU-bound, the two should be closely proportional. This does increase the end-to-end time of a CI run, though, since before this patch the two jobs could run in parallel, and the sanitizer job is our longest single job. It also means that we won't get a separate result for "this passed with UBSan but not with ASan" or vice versa). But as 1c0962c0c4 noted, that is not a very useful signal in practice. Below are some more detailed timings of gcc vs clang that I measured by running the test suite on my local workstation. Each measurement counts only the time to run the test suite with each compiler (not the compile time itself). We'll focus on the wall-clock times for simplicity, though the CPU times follow roughly similar trends. Here's a run with CC=gcc as a baseline: real 1m12.931s user 9m30.566s sys 8m9.538s Running with SANITIZE=address increases the time by a factor of ~4.7x: real 5m40.352s user 49m37.044s sys 36m42.950s Running with SANITIZE=undefined increases the time by a factor of ~1.7x: real 2m5.956s user 12m42.847s sys 19m27.067s So let's call that 6.4 time units to run them separately (where a unit is the time it takes to run the test suite with no sanitizers). As a simplistic model, we might imagine that running them together would take 5.4 units (we save 1 unit because we are no longer running the test suite twice, but just paying the sanitizer overhead on top of a single run). But that's not what happens. Running with SANITIZE=address,undefined results in a factor of 9.3x: real 11m9.817s user 77m31.284s sys 96m40.454s So not only did we not get faster when doing them together, we actually spent 1.5x as much CPU as doing them separately! And while those wall-clock numbers might not look too terrible, keep in mind that this is on an unloaded 8-core machine. In the CI environment, wall-clock times will be much closer to CPU times. So not only are we wasting CPU, but we risk hitting timeouts. Now let's try the same thing with clang. Here's our no-sanitizer baseline run, which is almost identical to the gcc one (which is quite convenient, because we can keep using the same "time units" to get an apples-to-apples comparison): real 1m11.844s user 9m28.313s sys 8m8.240s And now again with SANITIZE=address, we get a 5x factor (so slightly worse than gcc's 4.7x, though I wouldn't read too much into it; there is a fair bit of run-to-run noise): real 6m7.662s user 49m24.330s sys 44m13.846s And with SANITIZE=undefined, we are at 1.5x, slightly outperforming gcc (though again, that's probably mostly noise): real 1m50.028s user 11m0.973s sys 16m42.731s So running them separately, our total cost is 6.5x. But if we combine them in a single run (SANITIZE=address,undefined), we get: real 6m51.804s user 52m32.049s sys 51m46.711s which is a factor of 5.7x. That's along the lines we'd hoped for! Running them together saves us almost a whole time unit. And that's not counting any time spent outside the test suite itself (starting the job, setting up the environment, compiling) that we're no longer duplicating by having two jobs. So clang behaves like we'd hope: the overhead to run the sanitizers is additive as you add more sanitizers. Whereas gcc's numbers seem very close to multiplicative, almost as if the sanitizers were enforcing their overheads on each other (though that is purely a guess on what is going on; ultimately what matters to us is the amount of time it takes). And that roughly matches the CI improvement I saw. A "time unit" there is more like 12 minutes, and the observed time savings was 14 minutes (with the extra presumably coming from avoiding duplicated setup, etc). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-03ci: use clang for ASan/UBSan checksJeff King1-2/+2
Both gcc and clang support the "address" and "undefined" sanitizers. However, they may produce different results. We've seen at least two real world cases where gcc missed a UBSan problem but clang found it: 1. Clang's UBSan (using clang 14.0.6) found a string index that was subtracted to "-1", causing an out-of-bounds read (curiously this didn't trigger ASan, but that may be because the string was in the argv memory, not stack or heap). Using gcc (version 12.2.0) didn't find the same problem. Original thread: https://lore.kernel.org/git/20230519005447.GA2955320@coredump.intra.peff.net/ 2. Clang's UBSan (using clang 4.0.1) complained about pointer arithmetic with NULL, but gcc at the time did not. This was in 2017, and modern gcc does seem to find the issue, though. Original thread: https://lore.kernel.org/git/32a8b949-638a-1784-7fba-948ae32206fc@web.de/ Since we don't otherwise have a particular preference for one compiler over the other for this test, let's switch to the one that we think may be more thorough. Note that it's entirely possible that the two are simply _different_, and we are trading off problems that gcc would find that clang wouldn't. However, my subjective and anecdotal experience has been that clang's sanitizer support is a bit more mature (e.g., I recall other oddities around leak-checking where clang performed more sensibly). Obviously running both and cross-checking the results would give us the best coverage, but that's very expensive to run (and these are already some of our most expensive CI jobs). So let's use clang as our best guess, and we can re-evaluate if we get more data points. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-14Merge branch 'tb/ci-concurrency' into maint-2.39Junio C Hamano3-2/+50
Avoid unnecessary builds in CI, with settings configured in ci-config. * tb/ci-concurrency: ci: avoid unnecessary builds
2023-02-14Merge branch 'cw/ci-whitespace' into maint-2.39Junio C Hamano1-11/+46
CI updates. We probably want a clean-up to move the long shell script embedded in yaml file into a separate file, but that can come later. * cw/ci-whitespace: ci (check-whitespace): move to actions/checkout@v3 ci (check-whitespace): add links to job output ci (check-whitespace): suggest fixes for errors
2023-01-16Merge branch 'tb/ci-concurrency'Junio C Hamano3-2/+50
Avoid unnecessary builds in CI, with settings configured in ci-config. * tb/ci-concurrency: ci: avoid unnecessary builds
2023-01-16Merge branch 'pw/ci-print-failure-name-fix'Junio C Hamano1-2/+4
(cosmetic) CI regression fix. * pw/ci-print-failure-name-fix: ci(github): restore "print test failures" step name
2023-01-08Merge branch 'cw/ci-whitespace'Junio C Hamano1-11/+46
CI updates. We probably want a clean-up to move the long shell script embedded in yaml file into a separate file, but that can come later. * cw/ci-whitespace: ci (check-whitespace): move to actions/checkout@v3 ci (check-whitespace): add links to job output ci (check-whitespace): suggest fixes for errors
2023-01-04ci(github): restore "print test failures" step namePhillip Wood1-2/+4
As well as removing the explicit shell setting d8b21a0fe2 (CI: don't explicitly pick "bash" shell outside of Windows, fix regression, 2022-12-07) also reverted the name of the print test failures step introduced by 5aeb145780f (ci(github): bring back the 'print test failures' step, 2022-06-08). This is unfortunate as 5aeb145780f added a message to direct contributors to the "print test failures" step when a test fails and that step is no-longer known by that name on the non-windows ci jobs. In principle we could update the message to print the correct name for the step but then we'd have to deal with having two different names for the same step on different jobs. It is simpler for the implementation and contributors to use the same name for this step on all jobs. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-20ci (check-whitespace): move to actions/checkout@v3Chris. Webster1-1/+1
Get rid of deprecation warnings in the CI runs. Also gets the latest security patches. Signed-off-by: Chris. Webster <chris@webstech.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-20ci (check-whitespace): add links to job outputChris. Webster1-9/+25
A message in the step log will refer to the Summary output. The job summary output is using markdown to improve readability. The git commands and commits with errors are now in ordered lists. Commits and files in error are links to the user's repository. Signed-off-by: Chris. Webster <chris@webstech.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-20ci (check-whitespace): suggest fixes for errorsChris. Webster1-9/+28
Make the errors more visible by adding them to the job summary and display the git commands that will usually fix the problem. Signed-off-by: Chris. Webster <chris@webstech.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-20ci: only run win+VS build & tests in Git for Windows' forkJohannes Schindelin1-1/+1
It has been a frequent matter of contention that the win+VS jobs not only take a long time to run, but are also more easily broken than the other jobs (because they do not use the same `Makefile`-based builds as all other jobs), and to make matters worse, these breakages are also much harder to diagnose and fix than other jobs', especially for contributors who are happy to stay away from Windows. The purpose of these win+VS jobs is to maintain the CMake-based build of Git, with the target audience being Visual Studio users on Windows who are typically quite unfamiliar with `make` and POSIX shell scripting, but the benefit of whose expertise we want for the Git project nevertheless. The CMake support was introduced for that specific purpose, and already early on concerns were raised that it would put an undue burden on contributors to ensure that these jobs pass in CI, when they do not have access to Windows machines (nor want to have that). This developer's initial hope was that it would be enough to fix win+VS failures and provide the changes to be squashed into contributors' patches, and that it would be worth the benefit of attracting Windows-based developers' contributions. Neither of these hopes have panned out. To lower the frustration, and incidentally benefit from using way less build minutes, let's just not run the win+VS jobs by default, which appears to be the consensus of the mail thread leading up to https://lore.kernel.org/git/xmqqk0311blt.fsf@gitster.g/ Since the Git for Windows project still needs to at least try to attract more of said Windows-based developers, let's keep the jobs, but disable them everywhere except in Git for Windows' fork. This will help because Git for Windows' branch thicket is "continuously rebased" via automation to the `shears/maint`, `shears/main`, `shears/next` and `shears/seen` branches at https://github.com/git-for-windows/git. That way, the Git for Windows project will still be notified early on about potential breakages, but the Git project won't be burdened with fixing them anymore, which seems to be the best compromise we can get on this issue. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-10Merge branch 'js/ci-use-newer-up-down-artifact'Junio C Hamano1-8/+14
CI fix. * js/ci-use-newer-up-down-artifact: ci: avoid using deprecated {up,down}load-artifacts Action
2022-12-10Merge branch 'ab/ci-use-macos-12'Junio C Hamano1-2/+2
CI fix. * ab/ci-use-macos-12: CI: upgrade to macos-12, and pin OSX version
2022-12-10Merge branch 'ab/ci-retire-set-output'Junio C Hamano2-3/+3
CI fix. * ab/ci-retire-set-output: CI: migrate away from deprecated "set-output" syntax