-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devproxy-playwright.yml
84 lines (70 loc) · 2.61 KB
/
devproxy-playwright.yml
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
name: macOS Dev Proxy and Playwright
on:
push:
branches:
- main
- dev
workflow_dispatch:
jobs:
test:
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "npm"
- name: Install dependencies
run: npm ci
#################################
# Cache + install of Playwright #
#################################
- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/Library/Caches/ms-playwright
key: playwright-macos-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright Browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
################################
# Cache + install of Dev Proxy #
################################
- name: Store Dev Proxy's Version
run: |
DEVPROXY_VERSION=$(curl -s https://api.github.com/repos/microsoft/dev-proxy/releases/latest | jq .tag_name -r)
echo "Dev Proxy's Version: $DEVPROXY_VERSION"
echo "DEVPROXY_VERSION=$DEVPROXY_VERSION" >> $GITHUB_ENV
- name: Cache Dev Proxy
id: cache-devproxy
uses: actions/cache@v4
with:
path: ./devproxy
key: devproxy-macos-${{ env.DEVPROXY_VERSION }}
- name: Install Dev Proxy
if: steps.cache-devproxy.outputs.cache-hit != 'true'
run: bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)"
#######################
# Configure Dev Proxy #
#######################
- name: Run Dev Proxy
run: ./devproxy/devproxy &
- name: Install the Dev Proxy's certificate
timeout-minutes: 1
run: |
echo "Finding certificate..."
security find-certificate -c "Dev Proxy CA" -a -p > dev-proxy-ca.pem
echo "Trusting certificate..."
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev-proxy-ca.pem
echo "Certificate trusted."
##########################
# Start Playwright tests #
##########################
- name: Run Playwright tests
run: npx playwright test