Skip to content

Commit bdb00b7

Browse files
committed
TO-DROP: re-use install artifact from previous run
... to accelerate the inevitable edit/trigger/investigate cycle in GitHub workflow development. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7acbb03 commit bdb00b7

File tree

2 files changed

+2
-169
lines changed

2 files changed

+2
-169
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -6,178 +6,9 @@ permissions:
66
contents: read
77

88
jobs:
9-
build:
10-
runs-on: windows-latest
11-
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: setup-msys2
17-
uses: msys2/setup-msys2@v2
18-
with:
19-
msystem: MSYS
20-
update: true
21-
install: msys2-devel base-devel autotools cocom diffutils gcc gettext-devel libiconv-devel make mingw-w64-cross-crt mingw-w64-cross-gcc mingw-w64-cross-zlib perl zlib-devel xmlto docbook-xsl
22-
23-
- name: Build
24-
shell: msys2 {0}
25-
run: |
26-
(cd winsup && ./autogen.sh)
27-
./configure --disable-dependency-tracking --with-msys2-runtime-commit="$GITHUB_SHA"
28-
make -j8
29-
30-
- name: Install
31-
shell: msys2 {0}
32-
run: |
33-
make DESTDIR="$(pwd)"/_dest install
34-
35-
- name: Upload
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: install
39-
path: _dest/
40-
41-
minimal-sdk-artifact:
42-
runs-on: windows-latest
43-
needs: [build]
44-
outputs:
45-
git-artifacts-extract-location: ${{ steps.git-artifacts-extract-location.outputs.result }}
46-
env:
47-
G4W_SDK_REPO: git-for-windows/git-sdk-64
48-
steps:
49-
- name: get latest successful ci-artifacts run
50-
# Cannot just grab from https://github.com/git-for-windows/git-sdk-64/releases/tag/ci-artifacts
51-
# because we also need the git-artifacts
52-
id: ci-artifacts-run-id
53-
uses: actions/github-script@v7
54-
with:
55-
script: |
56-
const [ owner, repo ] = process.env.G4W_SDK_REPO.split('/')
57-
const info = await github.rest.actions.listWorkflowRuns({
58-
owner,
59-
repo,
60-
workflow_id: 938271, // ci-artifacts.yml
61-
status: 'success',
62-
per_page: 1
63-
})
64-
return info.data.workflow_runs[0].id
65-
- name: get the ci-artifacts build's artifacts
66-
shell: bash
67-
run: |
68-
run_id=${{ steps.ci-artifacts-run-id.outputs.result }} &&
69-
70-
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
71-
-L https://api.github.com/repos/$G4W_SDK_REPO/actions/runs/$run_id/artifacts |
72-
jq -r '.artifacts[] | [.name, .archive_download_url] | @tsv' |
73-
tr -d '\r' |
74-
while read name url
75-
do
76-
echo "$name"
77-
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
78-
-#sLo /tmp/"$name".zip "$url" &&
79-
unzip -qo /tmp/"$name".zip ||
80-
exit $?
81-
done
82-
ls -la
83-
- uses: actions/download-artifact@v4
84-
with:
85-
name: install
86-
path: install
87-
- name: overwrite MSYS2 runtime with the just-built msys2-runtime
88-
shell: bash
89-
run: |
90-
set -x &&
91-
mkdir minimal-sdk &&
92-
cd minimal-sdk &&
93-
tar xzf ../git-sdk-x86_64-minimal.tar.gz &&
94-
tar -C ../install -cf - . | tar xf - &&
95-
tar cvf - * .[0-9A-Za-z]* | gzip -1 >../git-sdk-x86_64-minimal.tar.gz
96-
- name: upload minimal-sdk artifact
97-
uses: actions/upload-artifact@v4
98-
with:
99-
name: minimal-sdk
100-
path: git-sdk-x86_64-minimal.tar.gz
101-
- name: run `uname`
102-
run: minimal-sdk\usr\bin\uname.exe -a
103-
- name: determine where `git-artifacts` want to be extracted
104-
id: git-artifacts-extract-location
105-
shell: bash
106-
run: |
107-
echo "result=$(tar Oxf git-artifacts.tar.gz git/bin-wrappers/git |
108-
sed -n 's|^GIT_EXEC_PATH='\''\(.*\)/git'\''$|\1|p')" >>$GITHUB_OUTPUT
109-
- name: upload git artifacts for testing
110-
uses: actions/upload-artifact@v4
111-
with:
112-
name: git-artifacts
113-
path: git-artifacts.tar.gz
114-
115-
test-minimal-sdk:
116-
needs: [minimal-sdk-artifact]
117-
uses: git-for-windows/git-sdk-64/.github/workflows/test-ci-artifacts.yml@main
118-
with:
119-
git-artifacts-extract-location: ${{ needs.minimal-sdk-artifact.outputs.git-artifacts-extract-location }}
120-
1219
ui-tests:
122-
needs: build
12310
uses: ./.github/workflows/ui-tests.yml
12411
with:
12512
msys2-runtime-artifact-name: install
12613
permissions:
12714
contents: read
128-
129-
generate-msys2-tests-matrix:
130-
runs-on: ubuntu-latest
131-
outputs:
132-
matrix: ${{ steps.matrix.outputs.matrix }}
133-
steps:
134-
- id: matrix
135-
uses: msys2/msys2-tests/gha-matrix-gen@main
136-
137-
msys2-tests:
138-
needs: [build, generate-msys2-tests-matrix]
139-
strategy:
140-
fail-fast: false
141-
matrix:
142-
include: ${{ fromJson(needs.generate-msys2-tests-matrix.outputs.matrix) }}
143-
144-
name: msys2-tests ${{ matrix.msystem }}-${{ matrix.cc }}
145-
runs-on: ${{ matrix.runner }}
146-
env:
147-
CC: ${{ matrix.cc }}
148-
CXX: ${{ matrix.cxx }}
149-
FC: ${{ matrix.fc }}
150-
steps:
151-
- id: msys2
152-
uses: msys2/setup-msys2@v2
153-
with:
154-
msystem: ${{ matrix.msystem }}
155-
update: true
156-
install: ${{ matrix.packages }}
157-
158-
- name: Add staging repo
159-
shell: msys2 {0}
160-
run: |
161-
sed -i '1s|^|[staging]\nServer = https://repo.msys2.org/staging/\nSigLevel = Never\n|' /etc/pacman.conf
162-
163-
- name: Update using staging
164-
shell: pwsh
165-
run: |
166-
msys2 -c 'pacman --noconfirm -Suuy'
167-
$ErrorActionPreference = 'Stop'
168-
$PSNativeCommandUseErrorActionPreference = $true
169-
msys2 -c 'pacman --noconfirm -Suu'
170-
171-
- name: Download msys2-runtime artifact
172-
uses: actions/download-artifact@v4
173-
with:
174-
name: install
175-
path: ${{ steps.msys2.outputs.msys2-location }}
176-
177-
- name: uname -a
178-
shell: msys2 {0}
179-
run: uname -a
180-
181-
- name: Run tests
182-
uses: msys2/msys2-tests@main
183-

.github/workflows/ui-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
with:
2020
name: ${{ inputs.msys2-runtime-artifact-name }}
2121
path: ${{ runner.temp }}/artifacts
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
run-id: 14879384125
2224
- name: replace MSYS2 runtime
2325
run: |
2426
$p = Get-ChildItem -Recurse "${env:RUNNER_TEMP}\artifacts" | where {$_.Name -eq "msys-2.0.dll"} | Select -ExpandProperty VersionInfo | Select -First 1 -ExpandProperty FileName

0 commit comments

Comments
 (0)