-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (81 loc) · 3.25 KB
/
e2e_tests.yml
File metadata and controls
95 lines (81 loc) · 3.25 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
name: 📊 E2E Tests
on:
workflow_dispatch:
jobs:
e2e:
name: E2E
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install and compile extension
run: |
npm ci
npm run compile
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.24.0
- name: Install E2E dependencies
run: pnpm install
working-directory: test/e2e
- name: Run E2E tests
uses: GabrielBB/xvfb-action@v1
with:
run: pnpm test:e2e
working-directory: test/e2e
env:
E2E_CLOUD: ${{ secrets.E2E_CLOUD }}
E2E_API_KEY: ${{ secrets.E2E_API_KEY }}
E2E_API_SECRET: ${{ secrets.E2E_API_SECRET }}
CI: true
- name: Generate Allure report
if: always()
run: pnpm exec allure generate allure-results -o allure-report --clean
working-directory: test/e2e
- name: Upload Allure report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-report-${{ github.run_number }}
path: test/e2e/allure-report
retention-days: 30
- name: Set timestamp.
if: always()
id: timestamp
run: echo "TIMESTAMP=$(date +%Y%m%d_%H%M%S_%3N)" >> $GITHUB_ENV
- name: Generate GitHub App token.
if: always()
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: cloudinary-devs
repositories: cld-vscode-test-allure-reports
# How to update the GitHub App token (need to be updated every year):
# 1. Create a GitHub App at https://github.com/organizations/cloudinary-devs/settings/apps
# - Name: cloudinary-devs-bot, Webhook: unchecked, Permissions: Contents (Read & write), Install: Only this account
# 2. Note the App ID, then generate a private key (Settings → Private keys → Generate). Save the .pem file.
# 3. Install the app: App settings → Install App → cloudinary-devs org → Only select repositories → cld-vscode-test-allure-reports
# 4. Add secrets to this repo (Settings → Secrets → Actions): APP_ID and APP_PRIVATE_KEY (.pem contents)
# 5. The token is generated above via actions/create-github-app-token using those secrets.
- name: Pushes to reports repository.
if: always()
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ steps.app-token.outputs.token }}
with:
source-directory: 'test/e2e/allure-report'
destination-github-username: 'cloudinary-devs'
destination-repository-name: 'cld-vscode-test-allure-reports'
user-email: ''
target-branch: main
target-directory: 'allure-report_ts_${{ env.TIMESTAMP }}'
- name: Write URL in summary.
if: always()
run: echo "### Test results https://jubilant-broccoli-www5lem.pages.github.io/allure-report_ts_${{ env.TIMESTAMP }}" >> $GITHUB_STEP_SUMMARY