-
Notifications
You must be signed in to change notification settings - Fork 92
164 lines (142 loc) · 5.46 KB
/
test-e2e-windows.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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: "Test: E2E (Windows)"
on:
workflow_call:
inputs:
grep:
required: false
description: "Only run tests matching this regex. Supports tags (comma-separated), titles, filenames, etc. For windows, use this format: (?=.*@win)(?=.*@feature)"
default: "@win"
type: string
repeat_each:
required: false
description: "Run each test N times, defaults to one."
default: 1
type: number
display_name:
required: false
description: "The name of the job as it will appear in the GitHub Actions UI."
default: "e2e-windows"
type: string
currents_tags:
required: false
description: "The tags to use for Currents recording."
default: ""
type: string
workflow_dispatch:
inputs:
grep:
required: false
description: "Tests tagged with @win are pre-filtered. Specify other tags, test titles, filenames, etc. to filter tests further."
default: "@win"
type: string
repeat_each:
required: false
description: "Run each test N times, defaults to one."
default: 1
type: number
permissions:
id-token: write
contents: read
jobs:
e2e-windows:
name: ${{ inputs.display_name }}
runs-on:
labels: [windows-latest-8x]
timeout-minutes: 80
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
AWS_S3_BUCKET: positron-test-reports
steps:
- uses: actions/checkout@v4
- name: Set screen resolution
shell: pwsh
run: |
Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install System Level Python
uses: actions/setup-python@v5
with:
python-version: "3.10.10"
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Install node dependencies
env:
npm_config_arch: x64
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
POSITRON_GITHUB_PAT: ${{ github.token }}
shell: pwsh
# nvm on windows does not see .nvmrc
#
# the installation of the npm package windows-process-tree is known to fail
# intermittently in the Github Actions build environment, so we retry
# this step a few times if necessary.
#
# see https://github.com/posit-dev/positron/issues/3481
run: |
corepack enable
.\scripts\run-with-retry.ps1 -maxAttempts 3 -command "npm install --fetch-timeout 120000"
npm --prefix test/automation ci
npm --prefix test/e2e ci
- name: Compile and Download
run: npm exec -- npm-run-all --max-old-space-size=4095 -lp compile "electron x64" playwright-install download-builtin-extensions
- name: Compile E2E Tests
run: |
npm --prefix test/automation run compile
npm --prefix test/e2e run compile
- name: Install python dependencies
run: |
curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/requirements.txt --output requirements.txt
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install ipykernel trcli
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.4.0"
- name: Install R packages
run: |
curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION
Rscript -e "install.packages('pak')"
Rscript -e "pak::local_install_dev_deps(ask = FALSE)"
- name: Setup Graphviz
uses: ts-graphviz/[email protected]
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tinytex: true
- name: Setup AWS S3 Access
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.QA_AWS_RO_ROLE }}
aws-region: ${{ secrets.QA_AWS_REGION }}
- name: Transform to Playwright tags $PW_TAGS
run: bash scripts/pr-tags-transform.sh "e2e-windows" "${{ inputs.grep }}"
shell: bash
- name: Send Results to GH Summary
uses: ./.github/actions/gen-report-dir
if: ${{ !cancelled() }}
- name: Run Tests on Windows (Electron)
env:
POSITRON_PY_VER_SEL: 3.10.10
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_PROJECT_ID: ZOs5z2
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
COMMIT_INFO_MESSAGE: ${{ github.event.head_commit.message }} # only works on push events
PWTEST_BLOB_DO_NOT_REMOVE: 1
CURRENTS_TAG: ${{ inputs.currents_tags || 'electron/win'}}
if: ${{ !cancelled() }}
run: npx playwright test --project "e2e-windows" --grep "${{ env.PW_TAGS }}" --workers 2 --repeat-each ${{ inputs.repeat_each }}
- name: Upload Playwright Report to S3
if: ${{ success() || failure() }}
uses: ./.github/actions/upload-report-to-s3
with:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
report-dir: ${{ env.REPORT_DIR }}