-
Notifications
You must be signed in to change notification settings - Fork 878
89 lines (88 loc) · 3.36 KB
/
test-e2e-playwright.yml
File metadata and controls
89 lines (88 loc) · 3.36 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
name: E2E Tests Playwright
on:
push:
branches:
- master
pull_request:
branches: [master]
workflow_dispatch:
inputs:
sha:
type: string
required: false
description: Target SHA
jobs:
test:
name: e2e-playwright
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
container:
image: ghcr.io/gitbutlerapp/ci-base-image@sha256:3eaeae1b07072796a53dc1e7585cdc1f462d0b11d10ecd3685c6fa8082d647dd
timeout-minutes: 60
env:
DESKTOP_PORT: 3000
BUTLER_PORT: 6978
VITE_E2E: "true"
VITE_BUTLER_PORT: 6978
VITE_BUTLER_HOST: "localhost"
VITE_BUILD_TARGET: "web"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
if: ${{ github.event_name != 'workflow_dispatch' }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
persist-credentials: false
ref: ${{ github.event.inputs.sha }}
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: e2e-playwright-rust-binaries
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Preset Git Configuration and but-testing location
run: |
echo "GIT_CONFIG_GLOBAL=$PWD/e2e/playwright/fixtures/.gitconfig" >> $GITHUB_ENV
echo BUT_TESTING=$PWD/target/debug/but-testing >> $GITHUB_ENV
- name: Setup node environment
uses: ./.github/actions/init-env-node
if: ${{ github.ref != 'refs/heads/master' }}
- id: get_playwright_version
uses: eviden-actions/get-playwright-version@4ab3bd9361d018d7931275b5106f2290fa54cfb6 # v1
if: ${{ github.ref != 'refs/heads/master' }}
- name: Cache playwright binaries
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.get_playwright_version.outputs.playwright-version }}
- run: cd e2e && pnpm exec playwright install --with-deps
if: ${{ steps.playwright-cache.outputs.cache-hit != 'true' && github.ref != 'refs/heads/master' }}
- run: apt-get update && apt-get install -y libnss3
if: ${{ steps.playwright-cache.outputs.cache-hit == 'true' && github.ref != 'refs/heads/master' }}
name: Install missing deps after cache hit
- name: Build gitbutler-git
run: cargo build -p gitbutler-git
- name: Build but-server
run: cargo build -p but-server
- name: Build but-testing
run: cargo build -p but-testing
- name: Build SvelteKit
run: pnpm build:desktop
if: ${{ github.ref != 'refs/heads/master' }}
- name: Run Playwright tests
run: pnpm exec turbo run test:e2e:playwright
if: ${{ github.ref != 'refs/heads/master' }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
./e2e/playwright-report/
./e2e/test-results/
retention-days: 30