-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (101 loc) · 3.74 KB
/
Copy pathe2e.yml
File metadata and controls
105 lines (101 loc) · 3.74 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
name: E2E
# Matrix e2e: one job PER PROTOCOL brings up `agent` + that one service, then
# runs every language client (Go/Node/Python/Java) UNDER plug against it,
# asserting the service is reachable BY NAME through plug's single data path (the
# userspace TUN). The agent, client and gRPC images are built ONCE and shared to
# the protocol jobs via an artifact. Each job writes its grid to the run Summary;
# a final `grid` job renders the full matrix.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
build:
name: Build images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build agent image (plug + SSH agent)
run: docker build -f agent/Dockerfile -t softwarity/plug:e2e .
- name: Build client + gRPC images
working-directory: e2e
run: docker compose -f compose.yml build
- name: Save all built images
run: |
docker save softwarity/plug:e2e plug-e2e-grpc \
plug-e2e-client-go plug-e2e-client-node plug-e2e-client-python plug-e2e-client-java \
| gzip > /tmp/e2e-images.tar.gz
- uses: actions/upload-artifact@v7
with:
name: e2e-images
path: /tmp/e2e-images.tar.gz
retention-days: 1
matrix:
name: ${{ matrix.proto }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
proto: [http, postgres, redis, mongo, amqp, mqtt, grpc, websocket]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v7
with:
name: e2e-images
path: /tmp
- name: Load prebuilt images
run: gunzip -c /tmp/e2e-images.tar.gz | docker load
- name: ${{ matrix.proto }} — every client under plug, by name
working-directory: e2e
env:
E2E_BUILD: "0" # images are preloaded; skip all builds
E2E_RESULT_DIR: results
run: bash matrix.sh ${{ matrix.proto }}
- uses: actions/upload-artifact@v7
if: always()
with:
name: e2e-result-${{ matrix.proto }}
path: e2e/results/*.txt
retention-days: 1
grid:
name: Matrix grid
needs: matrix
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
path: results
pattern: e2e-result-*
merge-multiple: true
- name: Render the coverage matrix into the run summary
run: |
langs="go node python java"
protos="http postgres redis mongo amqp mqtt grpc websocket"
{
echo "## plug e2e — reachable BY NAME under plug (TUN data path)"
echo
printf "| client |"; for p in $protos; do printf " %s |" "$p"; done; echo
# printf '%s': the separator starts with '-', which bare printf reads as a flag.
printf '%s' "|---|"; for p in $protos; do printf '%s' "---|"; done; echo
} >> "$GITHUB_STEP_SUMMARY"
for l in $langs; do
row="| **$l** |"
for p in $protos; do
v=$(grep -ho "\b$l=[A-Z?]*" "results/$p.txt" 2>/dev/null | cut -d= -f2 || true)
case "$v" in
PASS) cell="✅" ;;
"") cell="·" ;;
*) cell="❌" ;;
esac
row="$row $cell |"
done
echo "$row" >> "$GITHUB_STEP_SUMMARY"
done
{
echo; echo "✅ pass · ❌ fail · \`·\` not run"
echo
echo "> **macOS / Windows** coverage is in the **CI** workflow (native build + unit tests + a real-TUN \`selftest\` on each OS). This e2e protocol matrix is Linux-only because it runs Docker services."
} >> "$GITHUB_STEP_SUMMARY"