forked from msysgit/git
-
Notifications
You must be signed in to change notification settings - Fork 10
112 lines (105 loc) · 3.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on: [push, pull_request]
env:
DEVELOPER: 1
# If more than one workflow run is triggered for the very same commit hash
# (which happens when multiple branches pointing to the same commit), only
# the first one is allowed to run, the second will be kept in the "queued"
# state. This allows a successful completion of the first run to be reused
# in the second run via the `skip-if-redundant` logic in the `config` job.
#
# The only caveat is that if a workflow run is triggered for the same commit
# hash that another run is already being held, that latter run will be
# canceled. For more details about the `concurrency` attribute, see:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.sha }}
jobs:
windows-test:
name: win test
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
n:
- nr: 1
run: 7072653564
- nr: 2
run: 7072653731
- nr: 3
run: 7072653988
- nr: 4
run: 7072654240
- nr: 5
run: 7072654509
- nr: 6
run: 7072654736
- nr: 7
run: 7072654943
- nr: 8
run: 7072654990
- nr: 9
run: 7072655045
- nr: 10
run: 7072655115
concurrency:
group: windows-test-${{ matrix.n.nr }}-${{ github.ref }}
steps:
- name: reuse `windows-artifacts`
shell: bash
run: |
run_id=7069719923 &&
name=windows-artifacts &&
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-L https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts |
jq -r '.artifacts[] | select(.name | test("'$name'")) | [.name, .archive_download_url] | @tsv' |
tr -d '\r' |
while read name url
do
echo "$name"
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-#sLo /tmp/"$name".zip "$url" &&
unzip -q /tmp/"$name".zip
done
- name: extract tracked files and build artifacts
shell: bash
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
- name: do use current versions of a couple of files
shell: bash
run: |
# these have changed since the run whose artifacts we're reusing
for p in ci/lib.sh ci/run-test-slice.sh t/Makefile t/t3100-ls-tree-restrict.sh
do
curl -Lo $p ${{ github.server_url }}/${{ github.repository }}/raw/${{ github.sha }}/$p ||
exit 1
done
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: replace the MSYS2 runtime
shell: powershell
run: |
$headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" }
$run_url = "https://api.github.com/repos/dscho/Cygwin-msys2-fork/actions/runs/${{ matrix.n.run }}/artifacts"
$run = ((Invoke-WebRequest -Headers $headers $run_url).content | ConvertFrom-JSON)
$zip_url = $run.artifacts.archive_download_url
Invoke-WebRequest -Headers $headers $zip_url -outfile "install.zip"
Expand-Archive -Force -DestinationPath D:/git-sdk-64-minimal install.zip
Remove-Item install.zip
- name: test
id: test
shell: bash
timeout-minutes: 240
run: . /etc/profile && env >/tmp/env.txt && set >/tmp/set.txt && ci/run-test-slice.sh 0 1
- name: handle timed-out tests
if: failure() && steps.test.outcome == 'failure' && env.FAILED_TEST_ARTIFACTS == ''
shell: bash
run: . /etc/profile && . ci/lib.sh && { handle_failed_tests || test $? = 1; }
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
run: ci/print-test-failures.sh
- name: Upload failed/timed-out tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v3
with:
name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}}