-
Notifications
You must be signed in to change notification settings - Fork 92
144 lines (123 loc) · 4.63 KB
/
positron-merge-to-branch.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
name: "Positron: CI - Merge to main"
on:
push:
branches:
- main
- 'prerelease/**'
workflow_call:
inputs:
e2e_grep:
required: false
description: "Grep filter to apply to the e2e tests: @pr, @win, etc."
default: ""
type: string
workflow_dispatch:
inputs:
e2e_grep:
required: false
description: "Grep filter to apply to the e2e tests: @pr, @win, etc."
default: ""
type: string
env:
E2E_GREP: ${{ inputs.e2e_grep || '' }}
permissions:
id-token: write
contents: read
jobs:
e2e-electron:
timeout-minutes: 45
runs-on: ubuntu-latest-8x
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false # this check can be flaky in the R pkg tests
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
AWS_S3_BUCKET: positron-test-reports
REPORT_DIR: playwright-report-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- 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: Send HTML report URL to GitHub Summary
if: ${{ !cancelled() }}
run: |
REPORT_URL="https://d38p2avprg8il3.cloudfront.net/${{ env.REPORT_DIR }}/index.html"
echo "Report URL: $REPORT_URL"
echo "📄 [Playwright Report]($REPORT_URL) <br>" > $GITHUB_STEP_SUMMARY
- name: Run Playwright Tests (Electron)
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: "electron,${{ inputs.e2e_grep }}"
id: e2e-playwright-tests
run: DISPLAY=:10 npx playwright test --project e2e-electron --workers 2 --grep=${{ env.E2E_GREP }}
- 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 }}
unit-integration:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false # this check can be flaky in the R pkg tests
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Install Positron License
uses: ./.github/actions/install-license
with:
github-token: ${{ secrets.POSITRON_GITHUB_PAT }}
license-key: ${{ secrets.POSITRON_DEV_LICENSE }}
# one unit test needs this: Can list tables and fields from R connections
- name: Setup R
uses: ./.github/actions/install-r
with:
version: "4.4.0"
- name: Compile Integration Tests
run: yarn --cwd test/integration/browser compile
- name: Run Unit Tests (node.js)
id: nodejs-unit-tests
run: yarn test-node
- name: Run Integration Tests (Electron)
id: electron-integration-tests
run: DISPLAY=:10 ./scripts/test-integration-pr.sh
slack-notification:
name: "Send Slack notification"
runs-on: ubuntu-latest
needs: [unit-integration, e2e-electron]
if: ${{ failure() && inputs.e2e_grep == '' }}
steps:
- name: "Send Slack notification"
uses: testlabauto/[email protected]
with:
github_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack_channel: C07FR1JNZNJ #positron-test-results channel
suite_name: Positron Merge to Main Test Suite