-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (59 loc) · 2.1 KB
/
e2e.yaml
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
name: e2e Test
permissions: read-all
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
e2e:
name: e2e
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: clone kfc
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: defenseunicorns/kubernetes-fluent-client
path: kubernetes-fluent-client
- name: "set env: KFC"
run: echo "KFC=${GITHUB_WORKSPACE}/kubernetes-fluent-client" >> "$GITHUB_ENV"
- name: setup node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
cache: "npm"
cache-dependency-path: kubernetes-fluent-client
- name: install kubernetes-fluent-client deps
run: |
cd "$KFC"
npm ci
shell: bash
- name: "install k3d"
run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash"
shell: bash
- name: Set up Kubernetes
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
with:
version: "latest"
- name: "create k3d cluster"
run: "k3d cluster create kfc-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system"
shell: bash
- name: Prepare CRDs and Generate Classes
run: |
cd "$KFC"
kubectl apply -f test/ && npx ts-node src/cli.ts crd ./test/datastore.crd.yaml e2e && npx ts-node src/cli.ts crd https://raw.githubusercontent.com/defenseunicorns/kubernetes-fluent-client/refs/heads/471/test/webapp.crd.yaml e2e
shell: bash
- name: Prepare Image
run: |
cd "$KFC"
npm pack && npm i kubernetes-fluent-client-0.0.0-development.tgz --no-save
shell: bash
- name: Run the e2es
run: |
cd "$KFC"
npm run test:e2e
shell: bash