|
25 | 25 | concurrency: |
26 | 26 | group: windows-build-${{ github.ref }} |
27 | 27 | steps: |
28 | | - - uses: actions/checkout@v4 |
29 | 28 | - uses: git-for-windows/setup-git-for-windows-sdk@v1 |
| 29 | + - name: debug using tmate |
| 30 | + shell: bash |
| 31 | + run: | |
| 32 | + ( |
| 33 | + cd / && |
| 34 | + G4W=/c/Program\ Files/Git && |
| 35 | + cp -n "$G4W"/usr/bin/{ssh-keygen.exe,msys-crypto-3.dll,msys-z.dll} usr/bin/ && |
| 36 | +
|
| 37 | + CURL="$G4W"/mingw64/bin/curl.exe && |
| 38 | + "$CURL" -Lo /usr/bin/zstd.exe https://github.com/git-for-windows/git-sdk-64/raw/HEAD/usr/bin/zstd.exe && |
| 39 | + "$CURL" -Lo /tmp/tmate.tar.zst https://repo.msys2.org/msys/x86_64/tmate-2.4.0-4-x86_64.pkg.tar.zst && |
| 40 | + tar xvf /tmp/tmate.tar.zst usr/bin/tmate.exe && |
| 41 | + "$CURL" -Lo /tmp/libevent.tar.zst https://repo.msys2.org/msys/x86_64/libevent-2.1.12-4-x86_64.pkg.tar.zst && |
| 42 | + tar xvf /tmp/libevent.tar.zst usr/bin/msys-event-2-1-7.dll && |
| 43 | + "$CURL" -Lo /tmp/msgpack-c.tar.zst https://repo.msys2.org/msys/x86_64/msgpack-c-6.1.0-1-x86_64.pkg.tar.zst && |
| 44 | + tar xvf /tmp/msgpack-c.tar.zst usr/bin/msys-msgpack-c-2.dll && |
| 45 | + "$CURL" -Lo /tmp/libssh.tar.zst https://repo.msys2.org/msys/x86_64/libssh-0.11.1-1-x86_64.pkg.tar.zst && |
| 46 | + tar xvf /tmp/libssh.tar.zst usr/bin/msys-ssh-4.dll |
| 47 | + ) && |
| 48 | +
|
| 49 | + # restrict SSH access to the "actor", i.e. the GitHub user who triggered this workflow |
| 50 | + # this requires calling `ssh -i <private-key> [...]` later on |
| 51 | + mkdir -p ~/.ssh && |
| 52 | + curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ |
| 53 | + https://api.github.com/users/${{github.actor}}/keys | |
| 54 | + sed -n 's/.*"key": "\(.*\)".*/\1/p' >~/.ssh/authorized_keys && |
| 55 | +
|
| 56 | + # Generate an SSH key (needed for tmate) |
| 57 | + echo -e 'y\n' | ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && |
| 58 | +
|
| 59 | + # Start tmate session |
| 60 | + export CHERE_INVOKING=1 && |
| 61 | + tmate -S /tmp/tmate.sock -a ~/.ssh/authorized_keys new-session -d && |
| 62 | + tmate -S /tmp/tmate.sock wait tmate-ready && |
| 63 | +
|
| 64 | + # Print SSH invocation, then let the workflow continue |
| 65 | + tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' |
| 66 | + - uses: actions/checkout@v4 |
30 | 67 | - name: build |
31 | 68 | shell: bash |
32 | 69 | env: |
|
35 | 72 | run: . /etc/profile && ci/make-test-artifacts.sh artifacts |
36 | 73 | - name: run t0610 |
37 | 74 | run: cd t && sh t0610-*.sh -ivx |
| 75 | + - name: wait for tmate to be done |
| 76 | + if: always() |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + PATH=$HOME/bin:$PATH |
| 80 | + while test -e /tmp/tmate.sock |
| 81 | + do |
| 82 | + tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' |
| 83 | + sleep 5 |
| 84 | + done |
0 commit comments