2626 - uses : actions/setup-go@v3
2727 with :
2828 go-version : " 1.18"
29- # https://github.com/actions/cache/blob/main/examples.md#go---modules
30- - uses : actions/cache@v3
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-
29+ cache : true
3830 - run : make test STATIC_FILES=false GOTEST='go test -p 20 -covermode=atomic -coverprofile=coverage.out'
3931 # engineers just ignore this in PRs, so lets not even run it
4032 - run : bash <(curl -s https://codecov.io/bash)
@@ -48,41 +40,26 @@ jobs:
4840 steps :
4941 - uses : actions/checkout@v3
5042 - uses : docker/setup-buildx-action@v2
51- - name : Cache Docker layers
52- uses : actions/cache @v3
43+ - name : Build and export
44+ uses : docker/build-push-action @v3
5345 with :
54- path : /tmp/.buildx-cache
55- key : ${{ runner.os }}-single-buildx-${{ github.sha }}
56- restore-keys : |
57- ${{ runner.os }}-single-buildx
58- - name : build argoexec-image
59- run : |
60- docker buildx build \
61- -t quay.io/argoproj/argoexec:latest \
62- --target argoexec \
63- --cache-from "type=local,src=/tmp/.buildx-cache" \
64- --cache-to "type=local,dest=/tmp/.buildx-cache-new" \
65- --output=type=docker \
66- .
67- - run : docker save quay.io/argoproj/argoexec:latest > /tmp/argoexec_image.tar
46+ context : .
47+ tags : quay.io/argoproj/argoexec:latest
48+ outputs : type=docker,dest=/tmp/argoexec_image.tar
49+ target : argoexec
50+ cache-from : type=gha
51+ cache-to : type=gha,mode=max
6852 - uses : actions/upload-artifact@v3
6953 with :
7054 name : argoexec
7155 path : /tmp/argoexec_image.tar
7256 if-no-files-found : error
73- # Temp fix
74- # https://github.com/docker/build-push-action/issues/252
75- # https://github.com/moby/buildkit/issues/1896
76- - name : Move cache
77- run : |
78- rm -rf /tmp/.buildx-cache
79- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
8057
8158 e2e-tests :
8259 name : E2E Tests
8360 runs-on : ubuntu-latest
8461 timeout-minutes : 25
85- needs : [ tests, argoexec-image ]
62+ needs : [ argoexec-image ]
8663 env :
8764 KUBECONFIG : /home/runner/.kubeconfig
8865 strategy :
@@ -109,40 +86,51 @@ jobs:
10986 profile : minimal
11087 - test : test-python-sdk
11188 profile : minimal
89+ - test : test-executor
90+ install_k3s_version : v1.21.2+k3s1
91+ profile : minimal
92+ - test : test-corefunctional
93+ install_k3s_version : v1.21.2+k3s1
94+ profile : minimal
95+ - test : test-functional
96+ install_k3s_version : v1.21.2+k3s1
97+ profile : minimal
11298 steps :
99+ - name : Install socat
100+ # needed by Kubernetes v1.25
101+ run : sudo apt-get -y install socat
113102 - uses : actions/checkout@v3
114103 - uses : actions/setup-go@v3
115104 with :
116105 go-version : " 1.18"
106+ cache : true
117107 - uses : actions/setup-java@v3
108+ if : ${{matrix.test == 'test-java-sdk'}}
118109 with :
119110 java-version : ' 8'
120111 distribution : adopt
112+ cache : maven
121113 - uses : actions/setup-python@v4
114+ if : ${{matrix.test == 'test-python-sdk'}}
122115 with :
123116 python-version : ' 3.x'
124- - uses : actions/cache@v3
125- with :
126- path : |
127- ~/.cache/go-build
128- ~/go/pkg/mod
129- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
130- restore-keys : |
131- ${{ runner.os }}-go-
117+ cache : pip
132118 - name : Install and start K3S
133119 run : |
134- curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.2+k3s1 INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh -
120+ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${{matrix.install_k3s_version}} INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh -
135121 until kubectl --kubeconfig=/etc/rancher/k3s/k3s.yaml cluster-info ; do sleep 10s ; done
136122 cp /etc/rancher/k3s/k3s.yaml /home/runner/.kubeconfig
137123 echo "- name: fake_token_user" >> $KUBECONFIG
138124 echo " user:" >> $KUBECONFIG
139125 echo " token: xxxxxx" >> $KUBECONFIG
140126 until kubectl cluster-info ; do sleep 10s ; done
141127 - uses : actions/download-artifact@v3
128+ name : Download argoexec image
142129 with :
143130 name : argoexec
144131 path : /tmp
145132 - run : docker load < /tmp/argoexec_image.tar
133+ name : Load argoexec image
146134 - name : Set-up /etc/hosts
147135 run : |
148136 echo '127.0.0.1 dex' | sudo tee -a /etc/hosts
@@ -151,23 +139,60 @@ jobs:
151139 echo '127.0.0.1 mysql' | sudo tee -a /etc/hosts
152140 echo '127.0.0.1 azurite' | sudo tee -a /etc/hosts
153141 - run : make install PROFILE=${{matrix.profile}} STATIC_FILES=false
142+ name : Install manifests
154143 - run : make controller $(go env GOPATH)/bin/goreman STATIC_FILES=false
144+ name : Build controller
155145 - run : make cli STATIC_FILES=false
156146 if : ${{matrix.test == 'test-api' || matrix.test == 'test-cli' || matrix.test == 'test-java-sdk' || matrix.test == 'test-python-sdk'}}
157- - run : make start PROFILE=${{matrix.profile}} AUTH_MODE=client STATIC_FILES=false LOG_LEVEL=info API=${{matrix.test == 'test-api' || matrix.test == 'test-cli' || matrix.test == 'test-java-sdk' || matrix.test == 'test-python-sdk'}} UI=false AZURE=true > /tmp/argo.log 2>&1 &
147+ name : Build CLI
148+ - run : ./hack/port-forward.sh
149+ name : Start port forward
150+ - run : make start PROFILE=${{matrix.profile}} AUTH_MODE=client STATIC_FILES=false LOG_LEVEL=info API=${{matrix.test == 'test-api' || matrix.test == 'test-cli' || matrix.test == 'test-java-sdk' || matrix.test == 'test-python-sdk'}} UI=false LOGS=false > /tmp/argo.log 2>&1 &
151+ name : Start controller/API
158152 - run : make wait
159153 timeout-minutes : 4
160- - name : make ${{matrix.test}}
154+ name : Wait for controller to be up
155+ - name : Run tests ${{matrix.test}}
161156 # https://github.com/marketplace/actions/retry-step
162- uses :
nick-fields/[email protected] .1 157+ uses :
nick-fields/[email protected] .2 163158 with :
164159 timeout_minutes : 20
165160 max_attempts : 2
166- command : make ${{matrix.test}} E2E_SUITE_TIMEOUT=20m STATIC_FILES=false AZURE=true
161+ command : make ${{matrix.test}} E2E_SUITE_TIMEOUT=20m STATIC_FILES=false
162+ - if : ${{ failure() }}
163+ name : MinIO/MySQL deployment
164+ run : |
165+ set -eux
166+ kubectl get deploy
167+ kubectl describe deploy
167168 - if : ${{ failure() }}
169+ name : MinIO/MySQL pods
170+ run : |
171+ set -eux
172+ kubectl get pods -l '!workflows.argoproj.io/workflow'
173+ kubectl describe pods -l '!workflows.argoproj.io/workflow'
174+ - if : ${{ failure() }}
175+ name : MinIO/MySQL logs
176+ run : kubectl logs -l '!workflows.argoproj.io/workflow' --prefix
177+ - if : ${{ failure() }}
178+ name : Controller/API logs
168179 run : |
169180 [ -e /tmp/argo.log ] && cat /tmp/argo.log
170-
181+ - if : ${{ failure() }}
182+ name : Workflows
183+ run : |
184+ set -eux
185+ kubectl get wf
186+ kubectl describe wf
187+ - if : ${{ failure() }}
188+ name : Workflow pods
189+ run : |
190+ set -eux
191+ kubectl get pods -l workflows.argoproj.io/workflow
192+ kubectl describe pods -l workflows.argoproj.io/workflow
193+ - if : ${{ failure() }}
194+ name : Wait container logs
195+ run : kubectl logs -c wait -l workflows.argoproj.io/workflow --prefix
171196 codegen :
172197 name : Codegen
173198 runs-on : ubuntu-latest
@@ -180,14 +205,7 @@ jobs:
180205 - uses : actions/setup-go@v3
181206 with :
182207 go-version : " 1.19"
183- - uses : actions/cache@v3
184- with :
185- path : |
186- ~/.cache/go-build
187- ~/go/pkg/mod
188- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
189- restore-keys : |
190- ${{ runner.os }}-go-
208+ cache : true
191209 - name : Install protoc
192210 run : |
193211 set -eux -o pipefail
@@ -198,7 +216,9 @@ jobs:
198216 sudo find /usr/local/include -type f | xargs sudo chmod a+r
199217 sudo find /usr/local/include -type d | xargs sudo chmod a+rx
200218 ls /usr/local/include/google/protobuf/
201- - run : docker pull openapitools/openapi-generator-cli:v5.2.1 &
219+ - run : |
220+ docker pull openapitools/openapi-generator-cli:v5.4.0 &
221+ docker pull openapitools/openapi-generator-cli:v5.2.1 &
202222 - name : Create links
203223 run : |
204224 mkdir -p /home/runner/go/src/github.com/argoproj
@@ -218,14 +238,7 @@ jobs:
218238 - uses : actions/setup-go@v3
219239 with :
220240 go-version : " 1.18"
221- - uses : actions/cache@v3
222- with :
223- path : |
224- ~/.cache/go-build
225- ~/go/pkg/mod
226- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
227- restore-keys : |
228- ${{ runner.os }}-go-
241+ cache : true
229242 - run : make lint STATIC_FILES=false
230243 - run : git diff --exit-code
231244
@@ -240,10 +253,8 @@ jobs:
240253 - uses : actions/setup-node@v3
241254 with :
242255 node-version : " 16"
243- - uses : actions/cache@v3
244- with :
245- path : ui/node_modules
246- key : ${{ runner.os }}-node-dep-v1-${{ hashFiles('**/yarn.lock') }}
256+ cache : yarn
257+ cache-dependency-path : ui/yarn.lock
247258 - run : yarn --cwd ui install
248259 - run : yarn --cwd ui build
249260 - run : yarn --cwd ui test
0 commit comments