Skip to content

Commit 7aa8217

Browse files
authored
Adding cache to test (#1426)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent a926082 commit 7aa8217

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

.github/workflows/permissions.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,25 @@ jobs:
2727
node-version: '17'
2828
- name: Check out code into the Go module directory
2929
uses: actions/checkout@v2
30+
- uses: actions/cache@v2
31+
with:
32+
path: |
33+
~/.cache/go-build
34+
~/go/pkg/mod
35+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-
38+
- name: Get yarn cache directory path
39+
id: yarn-cache-dir-path
40+
run: echo "::set-output name=dir::$(yarn cache dir)"
3041

42+
- uses: actions/cache@v2
43+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
44+
with:
45+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-yarn-
3149
- name: Make assets
3250
run: |
3351
make assets

portal-ui/tests/scripts/initialize-env.sh

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,51 @@ __init__() {
6767
export GOPATH=/tmp/gopath
6868
export PATH=${PATH}:${GOPATH}/bin
6969

70-
go install github.com/minio/mc@latest
70+
ARCH="`uname -m`"
71+
case $ARCH in
72+
'i386')
73+
ARCH='amd64'
74+
alias ls='ls --color=auto'
75+
;;
76+
'x86_64')
77+
ARCH='amd64'
78+
alias ls='ls -G'
79+
;;
80+
'arm')
81+
ARCH='arm64'
82+
;;
83+
*) ;;
84+
esac
85+
86+
echo $ARCH
87+
88+
89+
OS="`uname`"
90+
case $OS in
91+
'Linux')
92+
OS='linux'
93+
alias ls='ls --color=auto'
94+
;;
95+
'FreeBSD')
96+
OS='freebsd'
97+
alias ls='ls -G'
98+
;;
99+
'WindowsNT')
100+
OS='windows'
101+
;;
102+
'Darwin')
103+
OS='darwin'
104+
;;
105+
'SunOS')
106+
OS='solaris'
107+
;;
108+
'AIX') ;;
109+
*) ;;
110+
esac
111+
112+
curl -sLO "https://dl.min.io/client/mc/release/$OS-$ARCH/mc" -o mc
113+
chmod +x mc
114+
mv mc /usr/local/bin
71115

72116
add_alias
73117
}

0 commit comments

Comments
 (0)