Repository navigation
116 lines (102 loc) · 5.02 KB
/
Copy pathserver_browser_tests.yaml
File metadata and controls
116 lines (102 loc) · 5.02 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
name: Server Browser Tests
# Runs the browser-driven server tests (playwright-java specs tagged `Browser`
# inside functional.PluginsTestSpec and functional.BrotliResponseCompressorSpec,
# the latter checking what chromium makes of brotli responses over https)
# in isolation from the main "Build & Test"
# job, so a crashed/hung browser driver can never stall the whole server test
# suite (see server_build_and_test.yaml + microsoft/playwright#35727).
#
# These tests drive the server-rendered login / back-office pages, which are
# served from the compiled JS assets, so the UI bundle must be built first:
# scripts/build.sh test_server_with_browser does clean + build_ui + compile + test.
on:
push:
paths:
- 'otoroshi/**'
- '.github/workflows/server_browser_tests.yaml'
pull_request:
paths:
- 'otoroshi/**'
- '.github/workflows/server_browser_tests.yaml'
workflow_dispatch:
jobs:
browser-tests:
runs-on: ubuntu-latest
# Hard cap: a hung browser driver fails here in <=1h instead of GitHub's 6h max.
timeout-minutes: 60
env:
SBT_OPTS: -Dsbt.override.build.repos=true -Xmx8G -Xss16M
COURSIER_PARALLEL_DOWNLOAD_COUNT: '4'
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Install sbt
uses: sbt/setup-sbt@v1.1.5
- uses: coursier/cache-action@v6
# Needed to build the UI bundles (build.sh build_ui -> npm run build).
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: otoroshi/javascript/package-lock.json
- name: install playwright dependencies
run: |
# the package index shipped with the runner image goes stale: a package it points to can be
# gone from the mirrors (404), so it is refreshed first
sudo apt-get update
sudo apt-get install libwoff1 \
libvpx9 \
libevent-2.1-7t64 \
libopus0 \
libgstreamer-plugins-base1.0-0 \
libgstreamer-gl1.0-0 \
libgstreamer-plugins-bad1.0-0 \
libharfbuzz-icu0 \
libsecret-1-0 \
libhyphen0 \
libmanette-0.2-0 \
libflite1 \
libgles2 \
gstreamer1.0-libav
# The Google mirror is a lagging snapshot of Maven Central: artifacts published
# in the last few days are often missing from it. So it is listed *before*
# maven-central rather than replacing it - coursier tries the mirror first and
# falls back to repo1.maven.org for whatever it has not synced yet. Do not add a
# coursier mirror.properties redirect here: it rewrites repo1.maven.org to the
# mirror as well, which kills that fallback and breaks fresh dependency bumps.
- name: Configure sbt repositories (mirror Maven Central via Google)
run: |
mkdir -p ~/.sbt
cat > ~/.sbt/repositories <<'EOF'
[repositories]
local
local-preloaded-ivy: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
local-preloaded: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}
maven-central-google: https://maven-central.storage-download.googleapis.com/maven2/
maven-central
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sbt-plugin-releases: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots
EOF
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
# keep this version in sync with com.microsoft.playwright:playwright in otoroshi/build.sbt
key: ${{ runner.os }}-playwright-1.44.0
- name: Install Playwright browser (chromium)
# playwright-java 1.44.0 uses the same chromium revision and default
# browsers path (~/.cache/ms-playwright) as the node playwright of the
# same version, so this deterministically pre-installs the exact browser
# instead of a lazy runtime download inside the test.
# NB: no --with-deps here — playwright 1.44's install-deps hardcodes
# `libasound2`, which no longer exists on Ubuntu 24.04 (renamed
# libasound2t64) and fails; the OS libs are installed by the apt step above.
run: npx --yes playwright@1.44.0 install chromium
- name: Build UI + run browser-tagged server tests
run: sh ./scripts/build.sh test_server_with_browser