-
-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (71 loc) · 2.25 KB
/
Copy pathtest.yml
File metadata and controls
81 lines (71 loc) · 2.25 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
name: Tests
on:
pull_request:
push:
branches:
- experimental
merge_group:
workflow_dispatch:
jobs:
test:
name: Test (${{ matrix.target }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- target: test
runs-on: ubuntu-latest
- target: safari-build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
submodules: true
- name: Setup build environment
uses: ./.github/actions/setup-browser-extension
- name: Run tests
if: ${{ matrix.target == 'test' }}
run: pnpm test
- name: Build Safari app
if: ${{ matrix.target == 'safari-build' }}
run: pnpm safari:build-app
bridge-smoke:
name: Bridge smoke (JVM mode)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Java
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
java-version: "25"
distribution: "temurin"
- name: Setup JBang
uses: jbangdev/setup-jbang@2b1b465a7b75f4222b81426f23a01e013aa7b95c # v0.1.1
- name: JBang build (JVM, no native-image)
working-directory: bridge
shell: bash
run: |
mkdir -p build
jbang export portable --force -O build/jabext-bridge.jar JabExtBridge.java
- name: Smoke /v1/health
working-directory: bridge
shell: bash
run: |
mkfifo keepalive.fifo
( tail -f /dev/null > keepalive.fifo & )
java -jar build/jabext-bridge.jar < keepalive.fifo > stdout.log 2> stderr.log &
BRIDGE_PID=$!
sleep 3
cat stderr.log
PORT=$(grep -oP 'listening on 127\.0\.0\.1:\K\d+' stderr.log)
if [ -z "$PORT" ]; then
echo "bridge failed to start" >&2
exit 1
fi
BODY=$(curl -s "http://127.0.0.1:$PORT/v1/health")
echo "health: $BODY"
echo "$BODY" | grep -q '"ok":true' || { echo "health failed" >&2; exit 1; }
kill $BRIDGE_PID || true