forked from getarcaneapp/arcane
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (127 loc) · 4.07 KB
/
Copy pathe2e-tests.yml
File metadata and controls
147 lines (127 loc) · 4.07 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
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Playwright E2E Tests
on:
push:
branches: [main]
paths-ignore:
- "**.md"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
permissions:
contents: read
actions: read
checks: write
pull-requests: write
id-token: write
concurrency:
group: "${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || github.ref }}"
cancel-in-progress: true
jobs:
build:
name: E2E Tests - Build Image
if: ${{ github.event_name != 'pull_request' || github.head_ref != 'l10n_crowdin' }}
timeout-minutes: 20
permissions:
contents: read
actions: write
id-token: write
runs-on: depot-ubuntu-24.04-16
steps:
- uses: actions/checkout@v6
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Build Arcane image for Playwright
uses: depot/build-push-action@v1
with:
context: .
file: docker/Dockerfile
load: true
tags: arcane:playwright-tests
build-args: |
BUILD_TAGS=playwright
provenance: true
sbom: true
- name: Export image to tarball
run: docker save arcane:playwright-tests -o /tmp/arcane-image.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v5
with:
name: arcane-image
path: /tmp/arcane-image.tar
retention-days: 1
test:
if: ${{ github.event_name != 'pull_request' || github.head_ref != 'l10n_crowdin' }}
permissions:
contents: read
actions: write
runs-on: depot-ubuntu-24.04-16
needs: build
strategy:
fail-fast: false
matrix:
database:
- name: sqlite
compose_file: setup/compose.yaml
port: 3000
- name: postgres
compose_file: setup/compose-postgres.yaml
port: 3001
- name: proxy
compose_file: setup/compose-proxy.yaml
port: 3002
name: E2E Tests (${{ matrix.database.name }})
steps:
- uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 25
cache: pnpm
- name: Cache Playwright Browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('tests/pnpm-lock.yaml', 'tests/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Create Docker Test Resources
run: |
docker volume create my-app-data || true
docker volume create cache || true
docker network create my-test-network || true
- name: Download Arcane Docker image artifact
uses: actions/download-artifact@v6
with:
name: arcane-image
path: /tmp
- name: Load Arcane Docker image
run: docker load -i /tmp/arcane-image.tar
- name: Pull and save test images
run: |
docker pull ghcr.io/linuxserver/nginx:latest
docker pull ghcr.io/linuxserver/radarr:nightly
docker save ghcr.io/linuxserver/nginx:latest ghcr.io/linuxserver/radarr:nightly > /tmp/test-images.tar
- name: Install test dependencies
run: pnpm --filter arcane-tests install
- name: Install Playwright Browsers
working-directory: ./tests
run: pnpm exec playwright install --with-deps chromium
- name: Run Playwright E2E tests
run: pnpm --filter arcane-tests test
env:
COMPOSE_FILE: ${{ matrix.database.compose_file }}
BASE_URL: http://localhost:${{ matrix.database.port }}
- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v5
with:
name: playwright-report-${{ matrix.database.name }}
path: tests/.report
include-hidden-files: true
retention-days: 15