-
Notifications
You must be signed in to change notification settings - Fork 92
138 lines (121 loc) · 4.95 KB
/
test-e2e-release.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
name: "Test: E2E (Latest Release)"
on:
workflow_dispatch:
inputs:
grep:
required: false
description: "Grep filter to apply to the e2e tests: @critical, @console, etc. Leave blank to run all tests."
default: ""
type: string
notify_on:
description: "Slack notification on:"
required: false
default: "failure"
type: choice
options:
- failure
- always
- never
permissions:
id-token: write
contents: read
jobs:
e2e-electron:
runs-on: ubuntu-latest-8x
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install Build Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
vim curl build-essential clang make cmake git \
libsodium-dev libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb \
libgtk-3-0 libgbm1 libnss3 libnspr4 libasound2 libkrb5-dev libcairo-dev \
libsdl-pango-dev libjpeg-dev libgif-dev pandoc
- name: Setup test dependencies and compile tests
run: |
# Must remove root package.json and provide simple stub to use root dir for test run but not build
rm package.json
echo '{"scripts":{"compile":"npx tsc"}}' > package.json
# Install TypeScript locally
npm install typescript
# Install required dependencies - must keep in sync with root package.json
npm install @playwright/test@^1.49.0
npx playwright install
npx playwright install-deps
npm install @currents/playwright@^1.8.0
npm install @midleman/github-actions-reporter@^1.9.5
npm install @vscode/v8-heap-parser@^0.1.0
npm install fs-extra
npm --prefix test/e2e install
npm --prefix test/e2e run compile
- name: Get & install latest release
id: get_latest_release
run: |
response=$(curl -s -H "Authorization: token ${{ secrets.POSITRON_GITHUB_PAT }}" "https://api.github.com/repos/posit-dev/positron-builds/releases")
latest_tag=$(echo "${response}" | jq -r '.[0].tag_name')
asset_url=$(echo "${response}" | jq -r '.[0].assets[] | select(.name|match("deb")) | .url')
filename=$(echo "${response}" | jq -r '.[0].assets[] | select(.name|match("deb")) | .name')
echo "Latest release: ${latest_tag}"
echo "Downloading ${filename} from ${asset_url}..."
curl -L -H "Accept: application/octet-stream" -H "Authorization: token ${{ secrets.POSITRON_GITHUB_PAT }}" "${asset_url}" -o "${filename}"
sudo dpkg -i "${filename}"
- name: Setup E2E Test Environment
uses: ./.github/actions/setup-test-env
with:
aws-role-to-assume: ${{ secrets.QA_AWS_RO_ROLE }}
aws-region: ${{ secrets.QA_AWS_REGION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure xvfb Service
shell: bash
run: |
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
- name: Send Results to GH Summary
uses: ./.github/actions/gen-report-dir
if: ${{ !cancelled() }}
- name: Transform to Playwright Tags $PW_TAGS
run: bash scripts/pr-tags-transform.sh "e2e-electron" "${{ inputs.grep }}"
shell: bash
- name: Run Tests (Electron)
if: ${{ !cancelled() }}
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
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 }}
PWTEST_BLOB_DO_NOT_REMOVE: 1
CURRENTS_TAG: "release,electron/linux"
id: electron-e2e-tests
run: |
export DISPLAY=:10
BUILD=/usr/share/positron npx playwright test --project e2e-electron --workers 2 --grep "${{ env.PW_TAGS }}"
- name: Upload Playwright Report to S3
if: ${{ !cancelled() }}
uses: ./.github/actions/upload-report-to-s3
with:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
report-dir: ${{ env.REPORT_DIR }}
slack-notify:
needs: [e2e-electron]
runs-on: ubuntu-latest
if: always()
env:
notify_on: ${{ github.event_name == 'schedule' && 'always' || inputs.notify_on || 'failure' }}
steps:
- run: |
echo "Will notify on: ${{ env.notify_on }}"
- name: Notify Slack
uses: midleman/slack-workflow-status@master
with:
repo_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_webhook_url: ${{ secrets.SLACK_TEST_RESULTS_WEBHOOK_URL }}
notify_on: ${{ env.notify_on }}