Skip to content

Commit db28d14

Browse files
committed
DEBUG
This is a bit more complex than `uses: mxschmitt/action-tmate@v3` because I need to do this in the context of the minimal SDK. Technically, I could do it with the MSYS2 installation, but the `windows-11-arm` runners do not have that by default. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent cdec961 commit db28d14

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/main.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,49 @@ jobs:
2929
- uses: git-for-windows/setup-git-for-windows-sdk@v1
3030
with:
3131
architecture: aarch64
32+
- name: debug using tmate (detached)
33+
shell: bash
34+
run: |
35+
set -x &&
36+
cat /etc/profile &&
37+
. /etc/profile &&
38+
(
39+
cd / &&
40+
G4W=/c/Program\ Files/Git &&
41+
cp -n "$G4W"/usr/bin/{ssh-keygen.exe,msys-crypto-3.dll,msys-z.dll} usr/bin/ &&
42+
43+
CURL="$WINDIR"/system32/curl.exe &&
44+
TAR="$WINDIR"/system32/tar.exe &&
45+
"$CURL" -Lo /tmp/tmate.tar.zst https://repo.msys2.org/msys/x86_64/tmate-2.4.0-5-x86_64.pkg.tar.zst &&
46+
"$TAR" xvf /tmp/tmate.tar.zst usr/bin/tmate.exe &&
47+
"$CURL" -Lo /tmp/libevent.tar.zst https://repo.msys2.org/msys/x86_64/libevent-2.1.12-4-x86_64.pkg.tar.zst &&
48+
"$TAR" xvf /tmp/libevent.tar.zst usr/bin/msys-event-2-1-7.dll &&
49+
"$CURL" -Lo /tmp/msgpack-c.tar.zst https://repo.msys2.org/msys/x86_64/msgpack-c-6.1.0-2-x86_64.pkg.tar.zst &&
50+
"$TAR" xvf /tmp/msgpack-c.tar.zst usr/bin/msys-msgpack-c-2.dll &&
51+
"$CURL" -Lo /tmp/libssh.tar.zst https://repo.msys2.org/msys/x86_64/libssh-0.11.1-2-x86_64.pkg.tar.zst &&
52+
"$TAR" xvf /tmp/libssh.tar.zst usr/bin/msys-ssh-4.dll
53+
) &&
54+
55+
# restrict SSH access to the "actor", i.e. the GitHub user who triggered this workflow
56+
# this requires calling `ssh -i <private-key> [...]` later on
57+
mkdir -p ~/.ssh &&
58+
curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
59+
https://api.github.com/users/${{github.actor}}/keys |
60+
sed -n 's/.*"key": "\(.*\)".*/\1/p' >~/.ssh/authorized_keys &&
61+
62+
# Generate an SSH key (needed for tmate)
63+
echo -e 'y\n' | ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa &&
64+
65+
# Start tmate session
66+
export CHERE_INVOKING=1 &&
67+
tmate -S /tmp/tmate.sock -a ~/.ssh/authorized_keys new-session -d &&
68+
tmate -S /tmp/tmate.sock wait tmate-ready &&
69+
70+
# Print SSH invocation
71+
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
72+
env:
73+
HOME: ${{runner.workspace}}
74+
NO_PERL: 1
3275
- name: build
3376
shell: bash
3477
env:
@@ -42,6 +85,16 @@ jobs:
4285
with:
4386
name: windows-artifacts
4487
path: artifacts
88+
- name: wait for tmate to be done
89+
if: always()
90+
shell: bash
91+
run: |
92+
PATH=$HOME/bin:$PATH
93+
while test -e /tmp/tmate.sock
94+
do
95+
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
96+
sleep 5
97+
done
4598
windows-test:
4699
name: win test
47100
runs-on: windows-11-arm

0 commit comments

Comments
 (0)