This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
97 lines (86 loc) · 3.13 KB
/
integration.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
name: integration
on:
pull_request:
permissions:
contents: read
jobs:
build-frontend:
runs-on: ubuntu-latest
outputs:
yarn-cache-key: ${{ steps.set-cache-key.outputs.cache-key}}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: set-cache-key
id: set-cache-key
run: echo "cache-key=waypoint-ui-v1-${{ hashFiles('ui/yarn.lock', 'ui/lib/**') }}" | tee -a "${GITHUB_OUTPUT}"
- name: save ui cache
id: ui-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
key: "${{ steps.set-cache-key.outputs.cache-key }}"
path: |-
ui/node_modules
ui/lib/node_modules
ui/dist/
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
if: steps.ui-cache.outputs.cache-hit == false
with:
node-version: 14
- name: install yarn packages
if: steps.ui-cache.outputs.cache-hit == false
run: yarn install
working-directory: ui
- name: Make UI
if: steps.ui-cache.outputs.cache-hit == false
run: make
working-directory: ui
dev-build:
runs-on: ubuntu-latest
needs:
- build-frontend
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: go.mod
- name: Restore UI cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
key: ${{ needs.build-frontend.outputs.yarn-cache-key }}
path: |-
ui/node_modules
ui/lib/node_modules
ui/dist/
- name: Make static assets (bindata_ui)
run: |-
go install github.com/kevinburke/go-bindata/...
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
make static-assets
- name: Make waypoint binary
run: |-
make bin
tar -cvf waypoint.tar ./waypoint
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
path: waypoint.tar
name: waypoint.tar
integration:
needs:
- dev-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup k3s
run: |-
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.26.3+k3s1" INSTALL_K3S_EXEC="--docker --disable=traefik --write-kubeconfig-mode=664" sh -
- name: Wait for kubernetes
run: |-
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
timeout 60s bash -c 'trap "echo Failed, timeout reached while waiting for kubernetes to launch 1>&2" SIGTERM; while ! kubectl get node 2>/dev/null ; do sleep 1 ; done; echo "Connected, ok"'
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: waypoint.tar
- name: Execute Integration Tests
run: |-
tar -xvf waypoint.tar
./ci/integration.sh