-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (130 loc) · 5.06 KB
/
Copy patha11y-eval-browser.yml
File metadata and controls
146 lines (130 loc) · 5.06 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
name: Browser-client-a11y-evaluation
run-name: Browser client a11y evaluation with extension build ${{ inputs.CLIENTS_BRANCH }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
CLIENTS_BRANCH:
default: "main"
description: "clients branch of browser build to use"
required: true
type: string
FEATURE_FLAGS:
default: "{}"
description: 'JSON key-value pairs representing feature flag states. (e.g. {"autofill-v2": true, "autofill-overlay": false})'
required: true
type: string
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
packages: read
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
node-version: "24"
- name: Create dotenv file
uses: ./.github/actions/setup-env-file
with:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
BW_DB_PORT: ${{ vars.BW_DB_PORT }}
BW_DB_PROVIDER: ${{ vars.BW_DB_PROVIDER }}
BW_DB_SERVER: ${{ vars.BW_DB_SERVER }}
BW_DOMAIN: ${{ vars.BW_DOMAIN }}
BW_ENABLE_SSL: ${{ vars.BW_ENABLE_SSL }}
BW_SSL_CERT: ${{ vars.BW_SSL_CERT }}
BW_SSL_KEY: ${{ vars.BW_SSL_KEY }}
CI: true
CLI_SERVE_HOST: ${{ vars.CLI_SERVE_HOST }}
CLI_SERVE_PORT: ${{ vars.CLI_SERVE_PORT }}
EXTENSION_BUILD_PATH: ${{ vars.EXTENSION_BUILD_PATH }}
PAGES_HOST_INSECURE_PORT: ${{ vars.PAGES_HOST_INSECURE_PORT }}
PAGES_HOST_PORT: ${{ vars.PAGES_HOST_PORT }}
PAGES_HOST: ${{ vars.PAGES_HOST }}
VAULT_HOST_INSECURE_PORT: ${{ vars.VAULT_HOST_INSECURE_PORT }}
VAULT_HOST_PORT: ${{ vars.VAULT_HOST_PORT }}
VAULT_HOST_URL: ${{ vars.VAULT_HOST_URL }}
- name: Create feature flags file
env:
_FEATURE_FLAGS: ${{ inputs.FEATURE_FLAGS }}
run: echo "{\"flagValues\":$_FEATURE_FLAGS}" > "flags.json"
- name: Download extension artifact
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-browser.yml
workflow_conclusion: ""
branch: ${{ inputs.CLIENTS_BRANCH }}
name: dist-chrome-MV3-\w{7}\.zip
name_is_regexp: true
repo: bitwarden/clients
if_no_artifact_found: fail
skip_unpack: true
- name: Unzip extension artifact
run: |
unzip -o "*dist-chrome-*.zip.zip"
unzip -o "dist-chrome*.zip" -d build
- name: Generate and install certs
run: |
npm run setup:ssl
sudo apt-get install -y libnss3-tools
. .env
mkdir -p "$HOME/.pki/nssdb"
certutil -d "$HOME/.pki/nssdb" -N --empty-password
certutil -d "sql:$HOME/.pki/nssdb" -A -t "CP,CP," -n TestAutomationSSL -i "./$BW_SSL_CERT"
- name: Install Bitwarden CLI
run: npm install -g @bitwarden/cli@2026.6.0
- name: Install project dependencies
run: |
npm ci
npx playwright install --with-deps chromium
- name: Build and start the test vault
run: docker compose up -d --build --remove-orphans --wait --wait-timeout 60
- name: Generate crypto values
run: npm run setup:crypto
- name: Setup the vault test account
run: npm run seed:vault:account
- name: Setup the vault test account ciphers
run: npm run seed:vault:ciphers
- name: Download test site build
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
workflow_conclusion: ""
branch: main
name: build-files
path: test-site
repo: bitwarden/test-the-web
if_no_artifact_found: fail
- name: Copy over certs and install test site dependencies
run: |
cp ssl.crt test-site/api/
cp ssl.key test-site/api/
cd test-site
npm ci
- name: Run browser client a11y evaluation
run: npm run test:a11y:browser:ci
- name: Update job summary
if: always()
run: echo "$(<./test-summary/test-summary.md)" >> "$GITHUB_STEP_SUMMARY"
- name: Upload results as artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: test-summary
path: |
./test-summary
./tests-out/videos
./tests-out/screenshots