Repository navigation
60 lines (52 loc) · 2.2 KB
/
Copy pathbuild.yml
File metadata and controls
60 lines (52 loc) · 2.2 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
name: Build
on:
push:
branches:
- main
- develop
pull_request:
jobs:
maven-build:
runs-on: ubuntu-latest
env:
# The Vite dev server is started by Playwright BEFORE `globalSetup`,
# so we must set the proxy target statically in the job environment here.
# GitHub-hosted runners have a native Docker daemon, so the backend is reachable via localhost.
VITE_BACKEND_ENDPOINT: "http://localhost:8080"
# Playwright stores browser binaries under ~/.cache/ms-playwright/ by default.
# We redirect them to a path within the project directory so the cache step below can reuse them between builds.
PLAYWRIGHT_BROWSERS_PATH: "${{ github.workspace }}/customer-management-client/.cache/ms-playwright"
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
key: playwright-${{ runner.os }}-${{ hashFiles('customer-management-client/package-lock.json') }}
- name: Install Playwright system dependencies
# Chromium runtime dependencies for Playwright (see https://playwright.dev/docs/ci#system-dependencies)
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends \
libnss3 libnspr4 libdbus-1-3 libdrm2 libgbm1 libxkbcommon0 \
libpango-1.0-0 libcairo2 libx11-6 libxcb1 libxext6 \
libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
libatk1.0-0t64 libatk-bridge2.0-0t64 libatspi2.0-0t64 \
libasound2t64 libcups2t64
- name: Build docker image
# Required by the frontend tests, which start the stack via testcontainers.
run: docker compose build
- name: Build and test
run: mvn --batch-mode clean install
- name: Upload server artifact
uses: actions/upload-artifact@v4
with:
name: customer-management-server-target
path: customer-management-server/target/
retention-days: 7