-
-
Notifications
You must be signed in to change notification settings - Fork 31
134 lines (131 loc) · 4.66 KB
/
Copy pathnodejs.yml
File metadata and controls
134 lines (131 loc) · 4.66 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-24.04
needs: [build]
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version: 20
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
- name: Install k3s
run: |
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=777 INSTALL_K3S_EXEC="server --docker --kubelet-arg=image-gc-high-threshold=85 --kubelet-arg=image-gc-low-threshold=80" sudo sh -
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $USER ~/.kube/config
- name: Install dependencies
run: npm ci
working-directory: e2e
# Do it before the browsers and dependencies get installed, because it takes long.
- name: Generate K8 files
run: |
version="$(bash .github/workflows/determine_docker_image_tag.sh)"
export RUSTFS_ACCESS_KEY="tryplaywright"
export RUSTFS_SECRET_KEY=$(openssl rand -base64 32)
export LOG_AGGREGATOR_URL="http://log-aggregator:8080"
export LOG_AGGREGATOR_ENABLED="true"
bash k8/generate.sh $version
env:
WORKER_COUNT: 1
- name: Deploy to k3s
run: |
kubectl delete deployment,service minio --ignore-not-found
kubectl apply -f k8/
- name: Install Playwright
run: npx playwright install --with-deps
working-directory: e2e
- name: Run e2e tests
working-directory: e2e
run: |
kubectl wait --timeout 10m --for=condition=ready pods --all
FRONTEND_PORT=$(kubectl get svc frontend -o=jsonpath='{.spec.ports[0].nodePort}')
FRONTEND_URL="http://127.0.0.1:$FRONTEND_PORT"
echo "Host: $FRONTEND_URL"
npx wait-on --timeout 120000 "$FRONTEND_URL/service/control/health"
kubectl wait --timeout 3m --for=condition=ready pod -l role=worker
AGG_PORT=$(kubectl get svc log-aggregator -o=jsonpath='{.spec.ports[?(@.port==8080)].nodePort}')
LOG_AGGREGATOR_URL="http://127.0.0.1:$AGG_PORT"
ROOT_TEST_URL=$FRONTEND_URL LOG_AGGREGATOR_URL=$LOG_AGGREGATOR_URL npm run test
env:
FLAKINESS_ACCESS_TOKEN: ${{ secrets.FLAKINESS_ACCESS_TOKEN }}
- name: Debug on failure
if: failure()
run: |
echo "=== Pod Status ==="
kubectl get pods -o wide
echo ""
echo "=== Control Service Logs ==="
kubectl logs deploy/control --tail=200 || true
echo ""
echo "=== Control Service Previous Logs (crashed) ==="
kubectl logs deploy/control --previous --tail=200 || true
echo ""
echo "=== Control Service Describe ==="
kubectl describe pod -l io.kompose.service=control || true
echo ""
echo "=== RabbitMQ Logs ==="
kubectl logs deploy/rabbitmq --tail=50 || true
echo ""
echo "=== etcd Logs ==="
kubectl logs deploy/etcd --tail=50 || true
echo ""
echo "=== File Service Logs ==="
kubectl logs deploy/file --tail=100 || true
echo ""
echo "=== RustFS Logs ==="
kubectl logs deploy/rustfs --tail=100 || true
echo ""
echo "=== RustFS Describe ==="
kubectl describe pod -l io.kompose.service=rustfs || true
- name: Upload playwright-report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: e2e-playwright-report
path: e2e/playwright-report/
build:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
directory:
- worker-javascript
- worker-java
- worker-python
- worker-csharp
- file-service
- frontend
- control-service
- log-aggregator
- squid
steps:
- uses: actions/checkout@v7
- name: Build image
run: docker build . --file ${{ matrix.directory }}/Dockerfile --tag local-image --build-arg GIT_SHA=${{ github.sha }}
- name: Login to GitHub Package Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.directory }}
DOCKER_IMAGE_TAG="$(bash .github/workflows/determine_docker_image_tag.sh)"
DOCKER_IMAGE="$IMAGE_ID:$DOCKER_IMAGE_TAG"
echo "Docker image: $DOCKER_IMAGE"
docker tag local-image $DOCKER_IMAGE
docker push $DOCKER_IMAGE