-
Notifications
You must be signed in to change notification settings - Fork 94
119 lines (91 loc) · 2.75 KB
/
openyurt-unit-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build and Test OpenYurt Deployer
on:
push:
branches: [ main, legacy-firecracker-v0.24.0-with-upf-support ]
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches: [ main, legacy-firecracker-v0.24.0-with-upf-support, openyurt ]
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:
env:
GOOS: linux
GO111MODULE: on
jobs:
main-unit-test:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Check out the code
uses: actions/checkout@v4
- name: Build scripts
run:
pushd scripts/openyurt-deployer && go build -o oy_deploy && popd
- name: Allow root login
run: |
echo "PermitRootLogin=yes" | sudo tee -a /etc/ssh/sshd_config
- name: Set up SSH and Run Test
run: |
echo $USER
sudo apt-get update
sudo apt-get install -y openssh-server
sudo service ssh start
eval "$(ssh-agent -s)"
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
cat > ~/.ssh/config <<EOF
Host host.example
User $USER
HostName 127.0.0.1
IdentityFile ~/.ssh/id_rsa
EOF
echo -n '' | cat - ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
sudo service ssh restart
service ssh status
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/authorized_keys
chmod og-rw ~/.ssh
cd scripts/openyurt-deployer
go test
node-unit-test:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Check out the code
uses: actions/checkout@v4
- name: Build scripts
run:
pushd scripts/openyurt-deployer && go build -o oy_deploy && popd
- name: Allow root login
run: |
echo "PermitRootLogin=yes" | sudo tee -a /etc/ssh/sshd_config
- name: Set up SSH and Run Test
run: |
echo $USER
sudo apt-get update
sudo apt-get install -y openssh-server
sudo service ssh start
eval "$(ssh-agent -s)"
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
cat > ~/.ssh/config <<EOF
Host host.example
User $USER
HostName 127.0.0.1
IdentityFile ~/.ssh/id_rsa
EOF
echo -n '' | cat - ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
sudo service ssh restart
service ssh status
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/authorized_keys
chmod og-rw ~/.ssh
cd scripts/openyurt-deployer/node
go test