Repository navigation
134 lines (121 loc) · 4.61 KB
/
Copy pathcanary.yml
File metadata and controls
134 lines (121 loc) · 4.61 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
name: 'CI: Canary Tests'
on:
schedule:
# Run every day at midnight
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
permissions:
contents: read
issues: write
jobs:
job_e2e_prepare:
name: Prepare E2E Canary tests
runs-on: namespace-profile-sentry-javascript-large
timeout-minutes: 30
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Check out current commit
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version-file: 'package.json'
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm run build
- name: Build tarballs
run: pnpm run build:tarball
# Same artifacts as in build.yml, so the test jobs can use the shared prepare-e2e-test action
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: packages/*/*.tgz
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
- name: Upload test-utils tarball artifact
uses: actions/upload-artifact@v7
with:
name: build-test-utils-tarball-output
path: dev-packages/test-utils/*.tgz
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine canary test applications
id: matrix
run: pnpm --silent run ci:build-matrix-canary >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
needs: [job_e2e_prepare]
if: needs.job_e2e_prepare.outputs.matrix != '{"include":[]}'
# Canary builds install prerelease dependencies, so they get their own cache volume.
runs-on:
${{ matrix.runner || 'namespace-profile-sentry-javascript-small'
}};overrides.cache-tag=sentry-javascript-e2e-canary
timeout-minutes: 20
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
# The `runtime` of a runtime variant, see dev-packages/e2e-tests/README.md
RUNTIME: ${{ matrix.runtime }}
# Without the root node_modules, `pnpm run` would first install the whole workspace.
pnpm_config_verify_deps_before_run: 'false'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_e2e_prepare.outputs.matrix) }}
steps:
- name: Check out current commit
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Prepare E2E test application
uses: ./.github/actions/prepare-e2e-test
with:
test-application: ${{ matrix.test-application }}
runtime: ${{ matrix.runtime }}
deno-version: ${{ matrix.deno-version }}
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 15
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Create Issue
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TITLE: ${{ matrix.label || matrix.test-application }} Test Failed
with:
filename: .github/CANARY_FAILURE_TEMPLATE.md
update_existing: true