Skip to content

Commit

Permalink
adding cache to gitactions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
derhnyel committed Nov 25, 2022
1 parent d0503f9 commit 3d3dc2d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ jobs:
go-version: '>=1.16'
- name: Checkout code
uses: actions/checkout@v2
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./web/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache go modules
id: cache-go-modules
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: ~/go
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup config script
# using locals for mac-OS because github CI mac platforms don't have docker
run: |
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ jobs:
go-version: '>=1.16'
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./web/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache go modules
id: cache-go-modules
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: ~/go
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup SSH server and config
# run docker ssh container for ssh tests
run: |
Expand All @@ -24,3 +49,6 @@ jobs:
run: |
go mod tidy
go test -v ./...


24 changes: 24 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ jobs:
go-version: '>=1.16'
- name: Checkout code
uses: actions/checkout@v2
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./web/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./web/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache go modules
id: cache-go-modules
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: ~/go
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Choco Install make
uses: crazy-max/ghaction-chocolatey@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif
dependencies:
ifeq ($(bin),main.exe)
@make prep-ci-local-windows
yarn add react-scripts@latest
cd web && yarn add react-scripts@latest
else
@make prep-ci-local
endif
Expand Down
14 changes: 10 additions & 4 deletions driver/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ func NewSSHForTest() Driver {
yamlPath := fmt.Sprintf("%s/%s", workingDir, "config-test.yaml")
conf := config.LoadConfig(yamlPath)
dashboardInfo := config.GetDashboardInfoConfig(conf)
var host config.Host
for ind := range dashboardInfo.Hosts {
if dashboardInfo.Hosts[ind].Address == "0.0.0.0" {
host = dashboardInfo.Hosts[ind]
}
}
return &SSH{
User: dashboardInfo.Hosts[0].Connection.Username,
Host: dashboardInfo.Hosts[0].Address,
Port: int(dashboardInfo.Hosts[0].Connection.Port),
KeyFile: dashboardInfo.Hosts[0].Connection.PrivateKeyPath,
User: host.Connection.Username,
Host: host.Address,
Port: int(host.Connection.Port),
KeyFile: host.Connection.PrivateKeyPath,
KeyPass: "",
CheckKnownHosts: false,
}
Expand Down

0 comments on commit 3d3dc2d

Please sign in to comment.