Skip to content

Commit d09d785

Browse files
author
josephkevinmachado
committed
2024-05-15-10-31-commit
1 parent 5f627bb commit d09d785

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: Test on macOS M1
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
48

59
jobs:
6-
build:
10+
setup-ssh:
711
runs-on: macos-12
812

913
steps:
@@ -17,16 +21,28 @@ jobs:
1721
env:
1822
DISPLAY: :0
1923

20-
- name: Wait for Docker to start
24+
- name: Install SSH server
25+
run: |
26+
brew install openssh
27+
sudo systemsetup -f -setremotelogin on
28+
29+
- name: Start SSH server
30+
run: sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
31+
32+
- name: Generate SSH key
2133
run: |
22-
while ! docker info > /dev/null 2>&1; do
23-
echo "Waiting for Docker to start..."
24-
sleep 2
25-
done
34+
ssh-keygen -t rsa -b 4096 -f ./id_rsa -N ""
35+
cat ./id_rsa.pub >> ~/.ssh/authorized_keys
36+
id: ssh-key
2637

27-
- name: Run Makefile commands
38+
- name: Display SSH connection info
2839
run: |
29-
make restart
30-
make setup
31-
make count-tables
40+
echo "Connect with the following command:"
41+
echo "ssh -i ./id_rsa $(whoami)@$(hostname)"
42+
env:
43+
SSH_KEY: ${{ steps.ssh-key.outputs.ssh-key }}
3244

45+
- name: Keep runner alive for 30 minutes
46+
run: |
47+
echo "Runner will stay alive for 30 minutes. Connect using SSH."
48+
sleep 1800

0 commit comments

Comments
 (0)