-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (82 loc) · 3.02 KB
/
kind-localsetup.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Test local setup
on:
pull_request:
paths:
- 'local-setup/**'
concurrency:
group: localsetup-${{ github.event.pull_request.number }}
cancel-in-progress: false
jobs:
kind-localsetup:
runs-on: ubuntu-latest-large
steps:
# Step 1: Checkout the code
- uses: actions/checkout@v4
# Step 2: Install github cli
- name: Install the gh cli
uses: ksivamuthu/actions-setup-gh-cli@v3
with:
version: 2.24.3
- run: |
gh version
# Step 3: Run start.sh
- name: Run start.sh
id: run_start_sh
env:
# GH_TOKEN: ${{ steps.generate-token.outputs.token }}
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
GH_USER: ${{ github.repository_owner }}
DEBUG: true
run: |
chmod +x ./local-setup/scripts/start.sh
./local-setup/scripts/start.sh
continue-on-error: true
- name: Debug
if: steps.run_start_sh.outcome == 'failure'
run: |
set -x
docker ps
curl -s -i http://localhost:8000/ || true
kubectl get pods -A -o wide
kubectl get svc -A
kubectl get helmreleases -A
kubectl get deployments -A
kubectl get secrets -A
kubectl get crds -A
kubectl get nodes -o wide
echo "Describe all pods which are not Running"
kubectl get pods -A --field-selector=status.phase!=Running -o jsonpath='{range .items[*]}{.metadata.namespace} {.metadata.name}{"\n"}{end}' | while read namespace name; do kubectl describe pod $name -n $namespace; done
echo "Describe all helmreleases which are not Ready yet"
kubectl get helmreleases -A -o json | jq -r '.items[] | select(.status.conditions[]? | select(.type == "Ready" and .status != "True")) | "\(.metadata.namespace) \(.metadata.name)"' | while read namespace name; do kubectl describe helmrelease $name -n $namespace; done
echo "Print imagePullSecret"
kubectl get secret ghcr-credentials -n openmfp-system -o yaml
echo "Test docker login and pull"
docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ steps.generate-token.outputs.token }}
docker pull ghcr.io/openmfp/portal:0.287.0
# Step 4: Prepare the NodeJS/playwright environment
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Step 5: Install NodeJS and dependencies
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'local-setup/e2e'
# Step 6: Install npm dependencies
- name: Clean install of npm dependencies
run: |
cd local-setup/e2e
npm install
npm ci
npx playwright install
# Step 7: Run the end-to-end tests
- name: End2End tests
run: |
cd local-setup/e2e/
npx playwright test