Skip to content

Commit 20737b3

Browse files
committed
TO-DROP: ci: reuse windows-artifacts from an earlier run
No need to re-build the same stuff over and over and over again. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b3bc29b commit 20737b3

File tree

1 file changed

+17
-33
lines changed

1 file changed

+17
-33
lines changed

.github/workflows/main.yml

+17-33
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,9 @@ concurrency:
1919
group: ${{ github.sha }}
2020

2121
jobs:
22-
windows-build:
23-
name: win build
24-
runs-on: windows-latest
25-
concurrency:
26-
group: windows-build-${{ github.ref }}
27-
steps:
28-
- uses: actions/checkout@v3
29-
- uses: git-for-windows/setup-git-for-windows-sdk@v1
30-
- name: replace the MSYS2 runtime
31-
shell: powershell
32-
run: |
33-
Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } "https://api.github.com/repos/msys2/msys2-runtime/actions/artifacts/1082027388/zip" -outfile "a1.zip"
34-
Expand-Archive -Force -DestinationPath D:/git-sdk-64-minimal a1.zip
35-
Remove-Item a1.zip
36-
- name: build
37-
shell: bash
38-
env:
39-
HOME: ${{runner.workspace}}
40-
NO_PERL: 1
41-
run: uname -a && . /etc/profile && ci/make-test-artifacts.sh artifacts
42-
- name: zip up tracked files
43-
run: git archive -o artifacts/tracked.tar.gz HEAD
44-
- name: upload tracked files and build artifacts
45-
uses: actions/upload-artifact@v3
46-
with:
47-
name: windows-artifacts
48-
path: artifacts
4922
windows-test:
5023
name: win test
5124
runs-on: windows-latest
52-
needs: [windows-build]
5325
strategy:
5426
fail-fast: false
5527
matrix:
@@ -76,11 +48,23 @@ jobs:
7648
concurrency:
7749
group: windows-test-${{ matrix.nr }}-${{ github.ref }}
7850
steps:
79-
- name: download tracked files and build artifacts
80-
uses: actions/download-artifact@v3
81-
with:
82-
name: windows-artifacts
83-
path: ${{github.workspace}}
51+
- name: reuse `windows-artifacts`
52+
shell: bash
53+
run: |
54+
run_id=7069719923 &&
55+
name=windows-artifacts &&
56+
57+
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
58+
-L https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts |
59+
jq -r '.artifacts[] | select(.name | test("'$name'")) | [.name, .archive_download_url] | @tsv' |
60+
tr -d '\r' |
61+
while read name url
62+
do
63+
echo "$name"
64+
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
65+
-#sLo /tmp/"$name".zip "$url" &&
66+
unzip -q /tmp/"$name".zip
67+
done
8468
- name: extract tracked files and build artifacts
8569
shell: bash
8670
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz

0 commit comments

Comments
 (0)