Skip to content

Commit 6696dff

Browse files
dschojeremyd2019
andcommitted
ci: run Git's entire test suite
One particularly important part of Git for Windows' MSYS2 runtime is that it is used to run Git's tests, and regressions happened there: For example, the first iteration of MSYS2 runtime v3.5.5 caused plenty of hangs. This was realized unfortunately only after deploying the msys2-runtime Pacman package, and some painful vacation-time scrambling was required to revert to v3.5.4.This was realized unfortunately only after deploying the msys2-runtime Pacman package, and some painful vacation-time scrambling was required to revert to v3.5.4. To verify that this does not happen anymore, let's reuse what `setup-git-for-windows-sdk` uses in Git's very own CI: - determine the latest successful `ci-artifacts` workflow run in git-for-windows/git-sdk-64 - download its Git files and build artifacts - download its minimal-sdk - overwrite the MSYS2 runtime in the minimal-sdk - run the test suite and the assorted validations just like the `ci-artifacts` workflow (from which these jobs are copied) This obviously adds a hefty time penalty (around 7 minutes!) to every MSYS2 runtime PR in the git-for-windows org. Happily, these days we don't need many of those, and the balance between things like the v3.5.5 scramble and waiting a little longer for the CI to finish is clearly in favor of the latter. Co-authored-by: Jeremy Drake <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent fdff7b5 commit 6696dff

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/build.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,81 @@ jobs:
3434
with:
3535
name: install
3636
path: _dest/
37+
minimal-sdk-artifact:
38+
runs-on: windows-latest
39+
needs: [build]
40+
outputs:
41+
git-artifacts-extract-location: ${{ steps.git-artifacts-extract-location.outputs.result }}
42+
env:
43+
G4W_SDK_REPO: git-for-windows/git-sdk-64
44+
steps:
45+
- name: get latest successful ci-artifacts run
46+
# Cannot just grab from https://github.com/git-for-windows/git-sdk-64/releases/tag/ci-artifacts
47+
# because we also need the git-artifacts
48+
id: ci-artifacts-run-id
49+
uses: actions/github-script@v7
50+
with:
51+
script: |
52+
const [ owner, repo ] = process.env.G4W_SDK_REPO.split('/')
53+
const info = await github.rest.actions.listWorkflowRuns({
54+
owner,
55+
repo,
56+
workflow_id: 938271, // ci-artifacts.yml
57+
status: 'success',
58+
per_page: 1
59+
})
60+
return info.data.workflow_runs[0].id
61+
- name: get the ci-artifacts build's artifacts
62+
shell: bash
63+
run: |
64+
run_id=${{ steps.ci-artifacts-run-id.outputs.result }} &&
65+
66+
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
67+
-L https://api.github.com/repos/$G4W_SDK_REPO/actions/runs/$run_id/artifacts |
68+
jq -r '.artifacts[] | [.name, .archive_download_url] | @tsv' |
69+
tr -d '\r' |
70+
while read name url
71+
do
72+
echo "$name"
73+
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
74+
-#sLo /tmp/"$name".zip "$url" &&
75+
unzip -qo /tmp/"$name".zip ||
76+
exit $?
77+
done
78+
ls -la
79+
- uses: actions/download-artifact@v4
80+
with:
81+
name: install
82+
path: install
83+
- name: overwrite MSYS2 runtime with the just-built msys2-runtime
84+
shell: bash
85+
run: |
86+
set -x &&
87+
mkdir minimal-sdk &&
88+
cd minimal-sdk &&
89+
tar xzf ../git-sdk-x86_64-minimal.tar.gz &&
90+
tar -C ../install -cf - . | tar xf - &&
91+
tar cvf - * .[0-9A-Za-z]* | gzip -1 >../git-sdk-x86_64-minimal.tar.gz
92+
- name: upload minimal-sdk artifact
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: minimal-sdk
96+
path: git-sdk-x86_64-minimal.tar.gz
97+
- name: run `uname`
98+
run: minimal-sdk\usr\bin\uname.exe -a
99+
- name: determine where `git-artifacts` want to be extracted
100+
id: git-artifacts-extract-location
101+
shell: bash
102+
run: |
103+
echo "result=$(tar Oxf git-artifacts.tar.gz git/bin-wrappers/git |
104+
sed -n 's|^GIT_EXEC_PATH='\''\(.*\)/git'\''$|\1|p')" >>$GITHUB_OUTPUT
105+
- name: upload git artifacts for testing
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: git-artifacts
109+
path: git-artifacts.tar.gz
110+
test-minimal-sdk:
111+
needs: [minimal-sdk-artifact]
112+
uses: git-for-windows/git-sdk-64/.github/workflows/test-ci-artifacts.yml@main
113+
with:
114+
git-artifacts-extract-location: ${{ needs.minimal-sdk-artifact.outputs.git-artifacts-extract-location }}

0 commit comments

Comments
 (0)