Skip to content

Commit 3d3dc2d

Browse files
committed
adding cache to gitactions workflow
1 parent d0503f9 commit 3d3dc2d

File tree

5 files changed

+87
-5
lines changed

5 files changed

+87
-5
lines changed

.github/workflows/test-macos.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ jobs:
1414
go-version: '>=1.16'
1515
- name: Checkout code
1616
uses: actions/checkout@v2
17+
- name: Cache node modules
18+
id: cache-node-modules
19+
uses: actions/cache@v3
20+
env:
21+
cache-name: cache-node-modules
22+
with:
23+
path: ./web/node_modules
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
29+
- name: Cache go modules
30+
id: cache-go-modules
31+
uses: actions/cache@v3
32+
env:
33+
cache-name: cache-go-modules
34+
with:
35+
path: ~/go
36+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-build-${{ env.cache-name }}-
39+
${{ runner.os }}-build-
40+
${{ runner.os }}-
1741
- name: Setup config script
1842
# using locals for mac-OS because github CI mac platforms don't have docker
1943
run: |

.github/workflows/test-ssh.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@ jobs:
1414
go-version: '>=1.16'
1515
- name: Checkout code
1616
uses: actions/checkout@v2
17+
18+
- name: Cache node modules
19+
id: cache-node-modules
20+
uses: actions/cache@v3
21+
env:
22+
cache-name: cache-node-modules
23+
with:
24+
path: ./web/node_modules
25+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-build-${{ env.cache-name }}-
28+
${{ runner.os }}-build-
29+
${{ runner.os }}-
30+
- name: Cache go modules
31+
id: cache-go-modules
32+
uses: actions/cache@v3
33+
env:
34+
cache-name: cache-go-modules
35+
with:
36+
path: ~/go
37+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
38+
restore-keys: |
39+
${{ runner.os }}-build-${{ env.cache-name }}-
40+
${{ runner.os }}-build-
41+
${{ runner.os }}-
1742
- name: Setup SSH server and config
1843
# run docker ssh container for ssh tests
1944
run: |
@@ -24,3 +49,6 @@ jobs:
2449
run: |
2550
go mod tidy
2651
go test -v ./...
52+
53+
54+

.github/workflows/test-windows.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ jobs:
1414
go-version: '>=1.16'
1515
- name: Checkout code
1616
uses: actions/checkout@v2
17+
- name: Cache node modules
18+
id: cache-node-modules
19+
uses: actions/cache@v3
20+
env:
21+
cache-name: cache-node-modules
22+
with:
23+
path: ./web/node_modules
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
29+
- name: Cache go modules
30+
id: cache-go-modules
31+
uses: actions/cache@v3
32+
env:
33+
cache-name: cache-go-modules
34+
with:
35+
path: ~/go
36+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-build-${{ env.cache-name }}-
39+
${{ runner.os }}-build-
40+
${{ runner.os }}-
1741
- name: Choco Install make
1842
uses: crazy-max/ghaction-chocolatey@v1
1943
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ endif
4040
dependencies:
4141
ifeq ($(bin),main.exe)
4242
@make prep-ci-local-windows
43-
yarn add react-scripts@latest
43+
cd web && yarn add react-scripts@latest
4444
else
4545
@make prep-ci-local
4646
endif

driver/ssh_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ func NewSSHForTest() Driver {
2626
yamlPath := fmt.Sprintf("%s/%s", workingDir, "config-test.yaml")
2727
conf := config.LoadConfig(yamlPath)
2828
dashboardInfo := config.GetDashboardInfoConfig(conf)
29+
var host config.Host
30+
for ind := range dashboardInfo.Hosts {
31+
if dashboardInfo.Hosts[ind].Address == "0.0.0.0" {
32+
host = dashboardInfo.Hosts[ind]
33+
}
34+
}
2935
return &SSH{
30-
User: dashboardInfo.Hosts[0].Connection.Username,
31-
Host: dashboardInfo.Hosts[0].Address,
32-
Port: int(dashboardInfo.Hosts[0].Connection.Port),
33-
KeyFile: dashboardInfo.Hosts[0].Connection.PrivateKeyPath,
36+
User: host.Connection.Username,
37+
Host: host.Address,
38+
Port: int(host.Connection.Port),
39+
KeyFile: host.Connection.PrivateKeyPath,
3440
KeyPass: "",
3541
CheckKnownHosts: false,
3642
}

0 commit comments

Comments
 (0)